/* PathCopilot 样式 - Apple风格白色简约设计 */

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

:root {
    /* 苹果风格主色调 */
    --primary-color: #007aff;      /* 苹果蓝 */
    --primary-light: #40a9ff;
    --primary-dark: #0056b3;
    
    /* 辅助色 - 苹果风格 */
    --secondary-color: #34c759;    /* 苹果绿 */
    --accent-color: #ff9500;       /* 苹果橙 */
    --danger-color: #ff3b30;       /* 苹果红 */
    --warning-color: #ffcc00;      /* 苹果黄 */
    
    /* 中性色 - 苹果风格白色简约 */
    --gray-50: #ffffff;            /* 纯白背景 */
    --gray-100: #f5f5f7;           /* 苹果浅灰 */
    --gray-200: #e8e8ed;
    --gray-300: #d2d2d7;
    --gray-400: #aeaeb2;
    --gray-500: #8e8e93;
    --gray-600: #636366;
    --gray-700: #48484a;
    --gray-800: #3a3a3c;
    --gray-900: #1d1d1f;           /* 苹果深灰文字 */
    
    /* 医疗主题色 */
    --medical-blue: #007aff;
    --medical-green: #34c759;
    --medical-purple: #af52de;
    
    /* 布局 */
    --header-height: 52px;         /* 苹果风格更紧凑 */
    --left-panel-width: 280px;     /* 更紧凑的左侧面板 */
    --right-panel-width: 360px;
    
    /* 阴影 - 更柔和 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.1);
    
    /* 圆角 - 苹果风格更圆润 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* 过渡 - 苹果风格更流畅 */
    --transition-fast: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-normal: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 主容器 */
.pathchat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--gray-100);
}

/* 顶部标题栏 - 苹果风格白色简约 */
.header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 0.5px solid var(--gray-300);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left i {
    font-size: 20px;
    color: var(--primary-color);
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--gray-900);
}

/* Logo渐变色效果 */
.logo-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 8px;
    font-weight: 400;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    animation: pulse 2s infinite;
}

.status-dot.ready {
    background-color: var(--secondary-color);
}

.status-dot.processing {
    background-color: var(--accent-color);
}

.status-dot.error {
    background-color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    background: var(--gray-100);
}

/* 面板通用样式 - 苹果风格 */
.left-panel, .right-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 0.5px solid var(--gray-300);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-panel {
    width: var(--left-panel-width);
    min-width: 200px;  /* 最小宽度 */
    max-width: 500px;  /* 最大宽度 */
    transition: none;  /* 拖拽时不需要过渡动画 */
}

/* 文件管理面板 - 确保可滚动 */
#fileManagerPanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.right-panel {
    width: var(--right-panel-width);
    min-width: 280px;  /* 最小宽度 */
    max-width: 600px;  /* 最大宽度 */
    border-right: none;
    border-left: 0.5px solid var(--gray-300);
    transition: none;  /* 拖拽时不需要过渡动画 */
}

.center-panel {
    flex: 1;
    min-width: 400px;  /* 中间面板最小宽度 */
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================
   可拖拽分割条样式
   ============================================================ */
.panel-resizer {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    z-index: 100;
    transition: background 0.2s ease;
}

.panel-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 40px;
    background: var(--gray-300);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease, height 0.2s ease;
}

.panel-resizer:hover::before {
    opacity: 1;
    height: 60px;
}

.panel-resizer:hover {
    background: rgba(0, 122, 255, 0.1);
}

.panel-resizer.dragging {
    background: rgba(0, 122, 255, 0.15);
}

.panel-resizer.dragging::before {
    opacity: 1;
    height: 80px;
    background: var(--primary-color);
}

/* 拖拽时禁止文本选择 */
body.resizing {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.resizing * {
    cursor: col-resize !important;
}

.panel-header {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--gray-300);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header i {
    color: var(--gray-500);
    font-size: 14px;
}

/* 左侧面板 - 文件管理（苹果风格） */
.upload-section {
    padding: 16px;
    border-bottom: 0.5px solid var(--gray-300);
}

.upload-area {
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    background: var(--gray-100);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.04);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.08);
    transform: scale(1.01);
}

.upload-area i {
    font-size: 36px;
    color: var(--gray-400);
    margin-bottom: 10px;
    display: block;
}

.upload-area p {
    margin: 6px 0;
    color: var(--gray-600);
}

.upload-hint {
    font-weight: 500;
    color: var(--gray-700);
}

.format-hint {
    font-size: 12px;
    color: var(--gray-500);
}

/* 上传进度 */
.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
}

/* ============ Patient Level 左侧面板样式 ============ */

#patientLevelPanel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.patient-level-header {
    background: linear-gradient(135deg, #af52de 0%, #bf5af2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 12px 16px 8px;
}

.pl-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.patient-level-header h3 {
    color: white;
    margin: 0;
    font-size: 15px;
}

.patient-level-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.patient-level-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pl-header-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
}

.pl-header-divider {
    margin: 0 4px;
    opacity: 0.5;
}

.pl-header-progress {
    margin-top: 6px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.pl-header-progress .progress-fill {
    background: rgba(255, 255, 255, 0.9);
}

.patient-level-header .pl-progress-current {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4px;
    gap: 4px;
    animation: none;
    padding: 0;
    background: none;
}

.patient-level-header .pl-progress-current i {
    font-size: 10px;
}

.patient-level-header .pl-progress-status {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 2px;
}

/* 患者信息区域 - 不再需要独立section，已集成到header */
.patient-info-section {
    display: none;
}

.patient-folder-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #af52de;
    margin-bottom: 8px;
}

.patient-folder-display i {
    font-size: 20px;
}

.patient-stats {
    font-size: 12px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-stats .divider {
    color: var(--gray-300);
}

/* WSI切片列表 */
.pl-wsi-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pl-wsi-list-section .section-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.pl-wsi-list-section .section-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pl-wsi-list-section .section-header h4 i {
    color: #af52de;
}

.pl-wsi-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* WSI卡片（可展开） */
.pl-wsi-card {
    margin-bottom: 8px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    overflow: hidden;
    transition: all 0.2s ease;
}

.pl-wsi-card:hover {
    border-color: rgba(175, 82, 222, 0.2);
}

.pl-wsi-card.selected {
    border-color: #af52de;
    background: rgba(175, 82, 222, 0.05);
}

.pl-wsi-card.expanded {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pl-wsi-card.analyzing {
    border-color: #af52de;
    animation: cardAnalyzingPulse 2s infinite;
}

@keyframes cardAnalyzingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(175, 82, 222, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(175, 82, 222, 0.15); }
}

/* WSI卡片头部 */
.pl-wsi-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pl-wsi-header:hover {
    background: rgba(175, 82, 222, 0.04);
}

.wsi-expand-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: var(--gray-500);
    transition: transform 0.2s ease;
}

.wsi-expand-toggle i {
    font-size: 10px;
}

.pl-wsi-card.expanded .wsi-expand-toggle {
    color: #af52de;
}

.pl-wsi-header .wsi-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.1), rgba(191, 90, 242, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 10px;
}

.pl-wsi-header .wsi-thumb i {
    font-size: 16px;
    color: #af52de;
}

.pl-wsi-header .wsi-info {
    flex: 1;
    min-width: 0;
}

.pl-wsi-header .wsi-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.pl-wsi-header .wsi-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wsi-part-tag {
    display: inline-block;
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
}

.pl-wsi-header .wsi-size {
    font-size: 10px;
    color: var(--gray-500);
}

.pl-wsi-header .wsi-status {
    flex-shrink: 0;
    margin-left: 8px;
}

.pl-wsi-header .status-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.pl-wsi-header .status-icon.pending {
    background: var(--gray-200);
    color: var(--gray-500);
}

.pl-wsi-header .status-icon.uploading,
.pl-wsi-header .status-icon.analyzing {
    background: rgba(175, 82, 222, 0.15);
    color: #af52de;
}

.pl-wsi-header .status-icon.analyzing i {
    animation: spin 1.5s linear infinite;
}

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

.pl-wsi-header .status-icon.uploaded,
.pl-wsi-header .status-icon.completed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.pl-wsi-header .status-icon.error {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

/* WSI卡片内容（分析树） */
.pl-wsi-body {
    border-top: 1px solid var(--gray-200);
    padding: 6px 8px;
    background: white;
}

.analysis-tree {
    padding-left: 4px;
}

.analysis-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    color: var(--gray-500);
    font-size: 12px;
}

.analysis-empty i {
    color: #af52de;
}

/* 分析树结构 - 紧凑布局 */
.tree-branch {
    margin-bottom: 3px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tree-item:hover {
    background: var(--gray-100);
}

.tree-item i {
    font-size: 10px;
}

.red-box-item {
    font-weight: 600;
    color: var(--gray-800);
}

.red-box-item .box-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 8px;
}

.tree-children {
    padding-left: 24px;
    border-left: 1px dashed var(--gray-300);
    margin-left: 12px;
}

.blue-box-item {
    color: var(--gray-700);
}

.blue-box-item .box-status {
    margin-left: auto;
    font-size: 10px;
}

.blue-box-item .box-status.completed {
    color: #34c759;
}

.blue-box-item .box-status.analyzing {
    color: #af52de;
}

/* ⭐ 模型输出观察结果样式 - 紧凑布局，贴左 */
.box-observation {
    font-size: 11px;
    color: #444;
    line-height: 1.5;
    padding: 4px 6px;
    margin: 1px 0 3px 2px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: none;
    overflow-y: visible;
}

.red-observation {
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.04);
}

.blue-observation {
    border-color: #007aff;
    background: rgba(0, 122, 255, 0.04);
    margin-left: 8px;
}

.green-observation {
    border-color: #34c759;
    background: rgba(52, 199, 89, 0.04);
    margin-left: 16px;
}

.green-box-branch {
    margin-bottom: 4px;
}

.green-box-item {
    color: var(--gray-600);
    font-size: 11px;
    padding: 4px 8px;
}

.green-box-item .box-label {
    font-size: 10px;
}

.green-children {
    padding-left: 12px;
}

.blue-children {
    padding-left: 8px;
}

.box-label {
    font-weight: 500;
}

.box-status.completed {
    color: #34c759;
}

.box-status.pending {
    color: var(--gray-400);
}

/* ⭐ 可点击的 ROI 项 */
.clickable-roi {
    cursor: pointer;
    transition: all 0.15s ease;
}

.clickable-roi:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}

.clickable-roi.active {
    background: rgba(175, 82, 222, 0.1);
    border-left: 2px solid #af52de;
    padding-left: 6px;
}

/* ⭐ 收起/展开图标 — 加大点击区域防误触 */
.toggle-icon {
    cursor: pointer;
    width: 24px;
    height: 24px;
    font-size: 10px;
    color: #666;
    margin-right: 2px;
    transition: transform 0.2s ease, background 0.15s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.toggle-icon:hover {
    color: #673ab7;
    background: rgba(103, 58, 183, 0.1);
}

.toggle-placeholder {
    width: 24px;
    display: inline-block;
    margin-right: 2px;
    flex-shrink: 0;
}

/* 分支折叠状态 */
.tree-branch.collapsed > .tree-children {
    display: none;
}

.tree-branch.expanded > .tree-children {
    display: block;
}

/* 旧样式保留兼容 */
.pl-wsi-item .status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.pl-wsi-item .status-icon.pending {
    background: var(--gray-200);
    color: var(--gray-500);
}

.pl-wsi-item .status-icon.uploading {
    background: rgba(0, 122, 255, 0.15);
    color: var(--primary-color);
}

.pl-wsi-item .status-icon.uploaded {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.pl-wsi-item .status-icon.analyzing {
    background: rgba(175, 82, 222, 0.15);
    color: #af52de;
    animation: spin 1.5s linear infinite;
}

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

.pl-wsi-item .status-icon.completed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.pl-wsi-item .status-icon.error {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

/* 进度区域 */
.pl-progress-section {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.pl-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.pl-progress-section .progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.pl-progress-section .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #af52de, #bf5af2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.pl-progress-status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-600);
    text-align: center;
}

/* 当前正在分析的 WSI 提示 */
.pl-progress-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.08), rgba(191, 90, 242, 0.08));
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #af52de;
    font-weight: 500;
    animation: currentWsiPulse 2s ease-in-out infinite;
}

.pl-progress-current i {
    font-size: 14px;
}

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

/* 综合诊断报告区域 */
/* ⭐ Patient Level 协作模式：按钮样式（用于报告审阅等） */
.pl-collab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pl-collab-btn-execute {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pl-collab-btn-execute:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.pl-collab-btn-modify {
    background: white;
    color: #667eea;
    border: 1.5px solid #667eea;
}

.pl-collab-btn-modify:hover {
    background: rgba(102,126,234,0.06);
}

.pl-report-section {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    max-height: 400px;
    overflow-y: auto;
}

.pl-report-section .section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #af52de;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ⭐ 综合诊断报告折叠功能样式 */
.pl-report-section .collapsible-header {
    padding: 12px 16px;
    background: rgba(175, 82, 222, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: background 0.2s ease;
}

.pl-report-section .collapsible-header:hover {
    background: rgba(175, 82, 222, 0.15);
}

.pl-report-section .collapsible-header .toggle-icon {
    transition: transform 0.2s ease;
    font-size: 12px;
    color: #af52de;
}

.pl-report-body {
    transition: all 0.2s ease;
}

.pl-report-content {
    font-size: 13px;
    line-height: 1.8;
    color: var(--gray-700);
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 3px solid #af52de;
    margin-bottom: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.pl-report-content h5 {
    margin: 8px 0 4px;
    font-size: 13px;
    color: var(--gray-800);
}

.pl-report-content li {
    margin-left: 16px;
    margin-bottom: 2px;
}

.pl-report-actions {
    text-align: center;
}

.pl-report-actions .download-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pl-report-actions .download-report-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.4);
}

/* 操作按钮 */
.pl-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

.pl-start-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #af52de 0%, #bf5af2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pl-start-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.4);
}

.pl-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pl-start-btn.running {
    background: linear-gradient(135deg, #ff9500, #ff9f0a);
}

/* ============ End Patient Level 左侧面板样式 ============ */

/* ============ Patient Level 弹窗和进度样式 ============ */

/* Patient Level 确认弹窗 */
.patient-level-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.patient-level-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.patient-level-modal-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.patient-level-modal-header i {
    font-size: 28px;
    color: #af52de;
}

.patient-level-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.patient-level-modal-body {
    padding: 20px 24px;
}

.modal-message {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 16px;
    line-height: 1.6;
}

.modal-message strong {
    color: #af52de;
    font-size: 18px;
}

/* 文件预览列表 */
.detected-files-preview {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 20px;
    max-height: 180px;
    overflow-y: auto;
}

.preview-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    border: 1px solid var(--gray-200);
}

.preview-file-item:last-child {
    margin-bottom: 0;
}

.preview-file-item i {
    color: #af52de;
    font-size: 16px;
}

.preview-file-item .file-name {
    flex: 1;
    font-size: 13px;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-file-item .part-badge {
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.preview-file-item .file-size {
    font-size: 11px;
    color: var(--gray-500);
}

.preview-more {
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
    padding: 8px;
    font-style: italic;
}

/* 选项卡片 */
.patient-level-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.option-card:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.option-card.selected {
    border-color: #af52de;
    background: rgba(175, 82, 222, 0.05);
}

.option-card.recommended {
    border-color: #af52de;
}

.option-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--gray-100);
}

.option-card.recommended .option-icon,
.option-card.selected .option-icon {
    background: linear-gradient(135deg, #af52de, #bf5af2);
}

.option-icon i {
    font-size: 20px;
    color: var(--gray-600);
}

.option-card.recommended .option-icon i,
.option-card.selected .option-icon i {
    color: white;
}

.option-content h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.option-content p {
    margin: 0;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.5;
}

.recommended-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: linear-gradient(135deg, #34c759, #30d158);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* 弹窗底部 */
.patient-level-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--gray-200);
}

.patient-level-modal-footer .btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.patient-level-modal-footer .btn-cancel:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.patient-level-modal-footer .btn-confirm {
    padding: 10px 24px;
    border: none;
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.patient-level-modal-footer .btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.4);
}

/* Patient Level 进度面板 */
.patient-level-progress-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9000;
    overflow: hidden;
    animation: panelSlideUp 0.3s ease;
}

@keyframes panelSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-panel-header {
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-panel-header i {
    font-size: 18px;
}

.progress-panel-header span {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.close-panel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.progress-panel-body {
    padding: 16px;
}

.patient-info-bar {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* WSI进度列表 */
.wsi-progress-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.wsi-progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.wsi-progress-item:last-child {
    margin-bottom: 0;
}

.wsi-progress-item .wsi-info {
    flex: 1;
    min-width: 0;
}

.wsi-progress-item .wsi-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wsi-progress-item .wsi-part {
    font-size: 10px;
    color: #af52de;
    font-weight: 500;
}

.wsi-progress-item .wsi-status {
    flex-shrink: 0;
    margin-left: 12px;
}

.wsi-progress-item .status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.wsi-progress-item .status-badge.pending {
    background: var(--gray-200);
    color: var(--gray-600);
}

.wsi-progress-item .status-badge.uploading {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.wsi-progress-item .status-badge.uploaded {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.wsi-progress-item .status-badge.analyzing {
    background: rgba(175, 82, 222, 0.15);
    color: #af52de;
    animation: pulse 1.5s infinite;
}

.wsi-progress-item .status-badge.completed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.wsi-progress-item .status-badge.error {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

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

/* 总进度条 */
.overall-progress {
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.overall-progress .progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.overall-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #af52de, #bf5af2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.overall-progress .progress-text {
    font-size: 12px;
    color: var(--gray-600);
    text-align: center;
}

/* 聊天消息中的Patient Level样式 - 居中占满宽度 */
.patient-level-start-msg {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.08), rgba(191, 90, 242, 0.08));
    border: 1px solid rgba(175, 82, 222, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
    max-width: 100%;
    text-align: center;
}

/* Patient Level 综合报告 - 普通聊天消息风格（左对齐） */
.patient-report-msg {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.05), rgba(191, 90, 242, 0.05));
    border: 1px solid rgba(175, 82, 222, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

/* 包含 Patient Level 消息的容器也要占满宽度 */
.assistant-message:has(.patient-level-start-msg),
.assistant-message:has(.patient-report-msg) {
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

.assistant-message:has(.patient-level-start-msg) .message-content,
.assistant-message:has(.patient-report-msg) .message-content {
    max-width: 100%;
    width: 100%;
}

.patient-level-start-msg h4,
.patient-report-msg h4 {
    margin: 0 0 12px;
    color: #af52de;
    font-size: 15px;
}

.patient-level-start-msg p,
.patient-report-msg p {
    margin: 6px 0;
    font-size: 13px;
    color: var(--gray-700);
}

.patient-level-start-msg .hint {
    color: var(--gray-500);
    font-style: italic;
    margin-top: 12px;
}

/* ⭐ Patient Level 协作模式：综合报告审阅卡片 */
.patient-report-review-card {
    background: linear-gradient(135deg, rgba(102,126,234,0.06), rgba(118,75,162,0.06));
    border: 1.5px solid rgba(102,126,234,0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
}

.patient-report-review-card .review-header h4 {
    margin: 0 0 8px;
    color: #667eea;
    font-size: 15px;
}

.patient-report-review-card .review-info {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0 0 12px;
}

.patient-report-review-card .review-report-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.patient-report-review-card .review-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.assistant-message:has(.patient-report-review-card) {
    width: 100%;
    max-width: 100%;
}

.assistant-message:has(.patient-report-review-card) .message-content {
    max-width: 100%;
    width: 100%;
}

.wsi-analysis-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.wsi-analysis-msg.success {
    background: rgba(52, 199, 89, 0.08);
}

.wsi-analysis-msg.error {
    background: rgba(255, 59, 48, 0.08);
}

.wsi-analysis-msg .wsi-icon {
    font-size: 16px;
}

.report-summary {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.6;
}

.report-summary h5 {
    margin: 12px 0 6px;
    font-size: 14px;
    color: var(--gray-800);
}

.report-summary li {
    margin-left: 16px;
    color: var(--gray-700);
}

.report-actions {
    margin-top: 16px;
    text-align: center;
}

.download-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #af52de, #bf5af2);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.4);
}

/* ============ End Patient Level 样式 ============ */

/* 文件列表 */
.files-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;  /* ⭐ 关键：允许flex子项收缩以启用滚动 */
}

.section-header {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.refresh-btn:hover {
    color: var(--primary-color);
    background: var(--gray-100);
}

.files-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
    min-height: 0;  /* ⭐ 关键：允许flex子项收缩以启用滚动 */
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* 文件项 */
.file-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.file-item.active {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.02);
}

.file-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.file-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.file-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
    word-break: break-all;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.file-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition-fast);
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn.danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 中间面板 - WSI查看器 */
.viewer-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: white;
    border: 1px solid var(--gray-300);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gray-600);
    transition: var(--transition-fast);
    font-size: 14px;
}

.control-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.wsi-viewer {
    width: 100%;
    height: 100%;
    background: var(--gray-200);
}

.viewer-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--gray-500);
    z-index: 1;
}

.viewer-empty i {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}

.viewer-empty h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.features {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    justify-content: center;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.feature i {
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0.7;
}

/* 查看器信息面板 */
.viewer-info {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    font-size: 12px;
    z-index: 10;
}

.info-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

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

.info-item span:first-child {
    color: var(--gray-600);
    font-weight: 500;
}

.info-item span:last-child {
    color: var(--gray-800);
    font-weight: 600;
}

/* 右侧面板 - 聊天 */
.chat-controls {
    display: flex;
    gap: 8px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

/* 用户消息靠右 */
.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    max-width: 85%;
}

/* AI消息靠左 */
.assistant-message .message-content {
    max-width: 90%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    display: none;  /* 隐藏头像，更简洁 */
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

/* 欢迎消息 - 简洁版，无头像 */
.welcome-message {
    justify-content: center;
    text-align: center;
}

.welcome-message .message-content {
    max-width: 400px;
}

.welcome-message .message-text p {
    margin-bottom: 8px;
    color: var(--gray-600);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary-color), var(--medical-green));
    color: white;
}

.message-content {
    min-width: 0;
}

.message-text {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 4px;
    box-shadow: var(--shadow-sm);
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.message-text p {
    margin-bottom: 8px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.capabilities {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.capabilities h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.capabilities ul {
    list-style: none;
    padding: 0;
}

.capabilities li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--gray-600);
}

.message-time {
    font-size: 11px;
    color: var(--gray-500);
    padding-left: 4px;
}

/* 输入区域 */
.chat-input-container {
    border-top: 1px solid var(--gray-200);
    background: white;
    padding: 16px 20px;
}

.roi-selection-info {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.roi-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

.clear-roi-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.clear-roi-btn:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.input-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: var(--transition-fast);
    background: white;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

/* 快捷操作 */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-700);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 300px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* 通知 */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px;
    max-width: 400px;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: var(--secondary-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification-text {
    flex: 1;
    font-size: 14px;
    color: var(--gray-800);
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.notification-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    :root {
        --left-panel-width: 260px;
        --right-panel-width: 300px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        min-width: auto;
        max-height: 300px;
    }
    
    .center-panel {
        min-height: 400px;
    }
    
    .header-left .subtitle {
        display: none;
    }
    
    .quick-actions {
        flex-direction: column;
    }
}

/* 滚动条样式 */
.files-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.files-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.files-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.files-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 选择状态 */
::selection {
    background: rgba(79, 70, 229, 0.2);
}

/* 焦点样式 */
.control-btn:focus,
.action-btn:focus,
.send-btn:focus,
.quick-action-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ROI选择信息覆盖层 */
.selection-info-overlay {
    position: absolute;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
}

.selection-info-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selection-header {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selection-size {
    color: #4ade80;
    font-weight: bold;
    font-size: 14px;
}

.selection-max-size {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

.selection-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
}

.selection-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

.selection-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.expand-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* 永久ROI信息显示 */
.permanent-roi-info {
    position: absolute;
    z-index: 999;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: var(--radius-xl);
    padding: 16px;
    font-size: 13px;
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
    backdrop-filter: blur(12px);
}

.roi-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.roi-header {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.roi-size {
    color: white;
    font-weight: bold;
    font-size: 16px;
    font-family: 'Courier New', monospace;
}

.roi-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.roi-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.roi-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.analyze-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* ROI矩形绘制中（拖拽时） - PathChat风格 */
/* ⭐ Bug修复：去掉背景填充，避免影响视觉选择 */
.roi-rectangle-drawing {
    pointer-events: none !important;
    border: 2px solid #7C3AED !important;
    background: transparent !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
    opacity: 0.8 !important;
    animation: roiPulse 1.5s infinite ease-in-out;
}

/* ROI矩形最终状态（选择完成后） - PathChat风格 */
/* ⭐ Bug修复：去掉背景填充，避免影响视觉选择 */
.roi-rectangle-final {
    pointer-events: none !important;
    border: 2px solid #7C3AED !important;
    background: transparent !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
    opacity: 1 !important;
}

/* ROI绘制动画 */
@keyframes roiPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
    }
}

/* 兼容旧样式 */
/* ⭐ Bug修复：去掉背景填充，避免影响视觉选择 */
.roi-rectangle-overlay {
    pointer-events: none;
    opacity: 0.9;
    border: 2px solid #7C3AED !important;
    background: transparent !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
}

/* ROI控制面板 */
.roi-control-panel {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 200px;
    animation: fadeInScale 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.roi-info {
    text-align: center;
    margin-bottom: 12px;
}

.roi-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
}

.roi-size {
    font-size: 16px;
    font-weight: 700;
    color: #e0e7ff;
}

.roi-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.roi-analyze-btn,
.roi-cancel-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.roi-analyze-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.roi-analyze-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.roi-cancel-btn {
    background: rgba(239, 68, 68, 0.2);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.roi-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-icon {
    font-size: 14px;
}

.btn-text {
    font-size: 13px;
}

/* PathChat风格ROI控制面板 */
.roi-control-panel-pathchat {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
    animation: fadeInScale 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.roi-info-pathchat {
    text-align: center;
    margin-bottom: 10px;
}

.roi-title-pathchat {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    opacity: 0.95;
}

.roi-size-pathchat {
    font-size: 15px;
    font-weight: 700;
    color: #f3f4f6;
}

.roi-actions-pathchat {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.roi-analyze-btn-pathchat,
.roi-cancel-btn-pathchat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.roi-analyze-btn-pathchat {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.roi-analyze-btn-pathchat:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.roi-cancel-btn-pathchat {
    background: rgba(107, 114, 128, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.roi-cancel-btn-pathchat:hover {
    background: rgba(107, 114, 128, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

/* ROI确认提示 */
.roi-confirmation-tip {
    position: relative;
    background: rgba(124, 58, 237, 0.1);
    color: #5B21B6;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.roi-confirmation-tip.show {
    opacity: 1;
    transform: translateY(0);
}

.roi-confirmation-tip .tip-icon {
    color: #10B981;
    font-weight: bold;
    font-size: 14px;
}

.roi-confirmation-tip .tip-text {
    flex: 1;
}

.roi-confirmation-tip .tip-close-btn {
    background: none;
    border: none;
    color: #9333EA;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    font-size: 12px;
    font-weight: bold;
}

.roi-confirmation-tip .tip-close-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}

/* 模式提示 */
.mode-hint {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 1000;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-hint.selection-mode {
    background: rgba(0, 122, 204, 0.9);
    border-color: rgba(0, 122, 204, 0.5);
    box-shadow: 0 4px 20px rgba(0, 122, 204, 0.3);
}

/* 动画效果 */
.selection-info-overlay,
.permanent-roi-info,
.mode-hint {
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 打印样式 */
@media print {
    .pathchat-container {
        height: auto;
    }
    
    .header,
    .chat-input-container,
    .viewer-controls,
    .file-actions,
    .selection-info-overlay,
    .permanent-roi-info {
        display: none;
    }
    
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .left-panel,
    .right-panel,
    .center-panel {
        width: 100%;
        min-width: auto;
        height: auto;
        border: none;
    }
}

/* 系统消息样式 */
.system-message {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-left: 4px solid #7C3AED;
    max-width: 90%;
    margin: 10px auto;
    border-radius: 8px;
    padding: 12px 16px;
}

.system-message .message-avatar {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
    color: white;
}

.roi-added-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.roi-icon {
    font-size: 16px;
}

.roi-text {
    color: #5B21B6;
    font-weight: 500;
    font-size: 14px;
}

.roi-hint {
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

/* ================ Agent相关样式 ================ */

/* Agent控制按钮 */
.agent-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--gray-300);
}

.agent-btn {
    background: var(--medical-purple);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.agent-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.agent-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
}

.agent-btn i {
    font-size: 14px;
}

/* 跟随模式开关 */
.follow-mode-toggle {
    position: relative;
    margin-left: 4px;
}

.follow-mode-toggle input[type="checkbox"] {
    display: none;
}

.follow-mode-toggle label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gray-200);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.follow-mode-toggle input:checked + label {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.follow-mode-toggle label:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Agent信息显示 */
.agent-info {
    background: rgba(124, 58, 237, 0.05);
    border-left: 2px solid var(--medical-purple);
}

/* Agent进度条 */
.agent-progress {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--medical-purple), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
}

/* 标签页样式 */
.panel-tabs {
    display: flex;
    gap: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn i {
    margin-right: 6px;
    font-size: 14px;
}

.panel-controls {
    display: flex;
    gap: 4px;
}

/* 标签页内容 */
.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-pane.active {
    display: flex;
}

/* Agent时间线样式 */
.agent-timeline-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.timeline-header h4 {
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.timeline-controls {
    display: flex;
    gap: 4px;
}

.agent-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
}

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

.timeline-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.timeline-empty p {
    font-size: 14px;
    margin: 0;
}

/* 时间线项目样式 */
.trace-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.trace-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.trace-item.active {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    box-shadow: var(--shadow-md);
}

.trace-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--gray-200);
}

.trace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.trace-step {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.trace-confidence {
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.trace-observation {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.trace-tools {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.trace-results {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.result-item {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.trace-decision {
    color: var(--gray-800);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--secondary-color);
    border-radius: 4px;
}

.trace-evidence {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.evidence-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.evidence-thumb:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Agent报告区域 */
.agent-report-section {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 16px;
    margin-top: auto;
}

.report-summary {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.report-summary h4 {
    color: var(--gray-800);
    font-size: 16px;
    margin-bottom: 8px;
}

.report-summary p {
    color: var(--gray-600);
    font-size: 14px;
    margin: 4px 0;
}

/* Agent Overlay样式 */
.agent-overlay {
    pointer-events: none;
    position: relative;
}

.overlay-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--medical-purple);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3);
    animation: overlay-pulse 2s infinite;
}

@keyframes overlay-pulse {
    0%, 100% { 
        border-color: var(--medical-purple);
        box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3);
    }
    50% { 
        border-color: var(--primary-light);
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    }
}

.overlay-label {
    position: absolute;
    top: -30px;
    left: 0;
    background: rgba(124, 58, 237, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.overlay-confidence {
    margin-left: 6px;
    opacity: 0.8;
    font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .agent-controls {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .agent-btn {
        min-width: 28px;
        height: 28px;
    }
    
    .agent-btn i {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .agent-controls {
        display: none;
    }
    
    .agent-progress {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .trace-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .trace-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ==================== 推理路径树状图样式 ==================== */

.reasoning-tree-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tree-header {
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.tree-header h4 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.tree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tree-visualization {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
}

.tree-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tree-empty p {
    font-size: 14px;
}

/* 树状节点样式 */
.tree-nodes {
    position: relative;
    padding: 20px;
}

.tree-node {
    position: relative;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tree-node:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    /* ⭐ 移除transform，防止节点抖动移位 */
}

.tree-node.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-lg);
}

/* 不同倍率的节点颜色 */
.tree-node.magnification-10x {
    border-left: 4px solid #FF0000;
}

.tree-node.magnification-40x {
    border-left: 4px solid #0066FF;
    margin-left: 30px;
}

.tree-node.magnification-200x {
    border-left: 4px solid #00CC00;
    margin-left: 60px;
}

.tree-node-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.magnification-10x .tree-node-icon {
    background: #FF0000;
}

.magnification-40x .tree-node-icon {
    background: #0066FF;
}

.magnification-200x .tree-node-icon {
    background: #00CC00;
}

.tree-node-content {
    flex: 1;
}

.tree-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tree-node-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
}

.tree-node.active .tree-node-title {
    color: white;
}

.tree-node-confidence {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.tree-node.active .tree-node-confidence {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tree-node-summary {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
}

.tree-node.active .tree-node-summary {
    color: rgba(255, 255, 255, 0.9);
}

.tree-node-metrics {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.metric-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.tree-node.active .metric-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 节点详情面板 */
.node-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--gray-200);
    max-height: 50%;
    overflow-y: auto;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.details-header h5 {
    font-size: 14px;
    color: var(--gray-800);
}

.details-content {
    padding: 16px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section h6 {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-weight: 600;
}

.detail-text {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.6;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.detail-metric-item {
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.detail-metric-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.detail-metric-value {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 600;
}

.detail-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 8px;
    border: 1px solid var(--gray-200);
}

/* ROI标注框样式增强 */
.roi-overlay-10x {
    border: 3px solid #FF0000 !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5) !important;
}

.roi-overlay-40x {
    border: 3px solid #0066FF !important;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5) !important;
}

.roi-overlay-160x {
    border: 3px solid #00CC00 !important;
    box-shadow: 0 0 10px rgba(0, 204, 0, 0.5) !important;
}

.roi-overlay-200x {
    border: 3px solid #00CC00 !important;
    box-shadow: 0 0 10px rgba(0, 204, 0, 0.5) !important;
}

.roi-overlay-label {
    position: absolute;
    top: -25px;
    left: 0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    pointer-events: none;
}

.roi-overlay-10x .roi-overlay-label {
    background: rgba(255, 0, 0, 0.9);
}

.roi-overlay-40x .roi-overlay-label {
    background: rgba(0, 102, 255, 0.9);
}

.roi-overlay-160x .roi-overlay-label {
    background: rgba(0, 204, 0, 0.9);
}

.roi-overlay-200x .roi-overlay-label {
    background: rgba(0, 204, 0, 0.9);
}

/* 可点击标注框提示 */
.roi-overlay-clickable {
    cursor: pointer;
    pointer-events: auto !important;  /* ⭐ 强制启用点击 */
}

.roi-overlay-clickable:hover {
    opacity: 0.8;
    filter: brightness(1.2);
}

/* ==================== 树状图模态窗口样式 ==================== */

/* 模态窗口容器 */
.tree-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.tree-modal.active {
    display: block;
}

/* 背景遮罩 */
.tree-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* 模态窗口内容 */
.tree-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98%;
    height: 96%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 模态窗口头部 */
.tree-modal-header {
    background: #fafafa;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.tree-modal-header h2 {
    margin: 0;
    color: #1d1d1f;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tree-modal-header h2 i {
    font-size: 22px;
    color: #6366f1;
}

.tree-modal-close {
    background: #f5f5f5;
    border: none;
    color: #666;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tree-modal-close:hover {
    background: #ff5f57;
    color: white;
}

/* 模态窗口主体 */
.tree-modal-body {
    flex: 1;
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    overflow: hidden;
    min-height: 0;
}

/* 左侧层级结构面板（统一面板，包含层级列表和节点详情） */
/* ⭐ 关键：不限制高度，允许无限滚动 */
.tree-structure-panel {
    width: 320px;
    min-width: 200px;
    max-width: 500px;
    background: #ffffff;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
    flex-shrink: 0;
}

/* ⭐ 可拖拽分隔条 - 极细线设计 */
.tree-resizer {
    width: 1px;
    cursor: col-resize;
    background: #e5e5e5;
    margin: 0;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.tree-resizer:hover,
.tree-resizer.dragging {
    background: #6366f1;
}

/* ⭐ 节点详情嵌入式面板 - 不限制高度，自然撑开 */
.tree-node-details-inline {
    background: #fafafa;
}

.tree-node-details-inline .details-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 0;
}

.tree-structure-header {
    background: #fafafa;
    color: #1d1d1f;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e5e5;
}

.tree-structure-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-structure-header h3 i {
    color: #6366f1;
}

.tree-structure-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    color: #666;
    padding: 4px 10px;
    border-radius: 8px;
}

.tree-structure-content {
    padding: 12px;
}

/* 树状结构项 */
.tree-item {
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

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

.tree-item-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tree-item-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.tree-item-header.level-10x {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tree-item-header.level-40x {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.tree-item-header.level-200x {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.tree-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.tree-item-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.tree-item-toggle {
    transition: transform 0.3s ease;
}

.tree-item-toggle.expanded {
    transform: rotate(180deg);
}

/* 子项列表 */
.tree-item-children {
    margin-top: 10px;
    margin-left: 20px;
    padding-left: 15px;
    border-left: 3px solid #e0e0e0;
    display: none;
}

.tree-item-children.expanded {
    display: block;
}

.tree-child-item {
    background: white;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tree-child-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(5px);
}

.tree-child-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.tree-child-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.tree-child-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.tree-child-confidence {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tree-child-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

/* 右侧可视化面板 */
.tree-visualization-panel {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.tree-visualization-header {
    background: #fafafa;
    color: #1d1d1f;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e5e5;
}

.tree-visualization-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-visualization-header h3 i {
    color: #6366f1;
}

.tree-visualization-controls {
    display: flex;
    gap: 8px;
}

.tree-control-btn {
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-control-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.tree-visualization-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    min-height: 0;
    min-width: 0;
}

/* SVG树状图样式 */
#treeSvg {
    background: #ffffff;
    width: 100%;
    height: 100%;
}

.tree-node {
    cursor: pointer;
}

/* ⭐ 简化hover效果，只改变阴影，不改变尺寸，防止抖动 */
.tree-node:hover rect:first-child {
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
}

.tree-node text {
    pointer-events: none;
    user-select: none;
}

/* 树状图连线动画 */
.tree-link {
    transition: stroke-width 0.3s ease;
}

.tree-link:hover {
    stroke-width: 4;
}

/* 树状图工具提示 */
.tree-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 10001;
    display: none;
    white-space: nowrap;
}

.tree-tooltip.active {
    display: block;
}

/* 路径详情面板 */
.path-details-panel {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 35%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.path-details-panel.collapsed {
    max-height: 0;
    border: none;
    overflow: hidden;
}

.path-details-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.path-details-header h4 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.path-details-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.path-details-close.collapsed {
    transform: rotate(180deg);
}

.path-details-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(40vh - 50px);
}

/* ⭐ 嵌入式节点详情样式（简洁版） */
.inline-node-detail {
    background: white;
}

.inline-detail-header {
    padding: 8px 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.inline-node-title {
    font-weight: 600;
    flex: 1;
}

.inline-node-zoom {
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.inline-node-conf {
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.inline-node-type {
    font-size: 14px;
}

.inline-node-type.malignant { color: #ffebeb; }
.inline-node-type.benign { color: #e8ffe8; }

/* 详情图片 */
.inline-detail-image {
    padding: 10px;
    background: #f5f5f5;
    text-align: center;
}

.inline-detail-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.inline-detail-image .img-error {
    color: #999;
    padding: 20px;
    font-size: 12px;
}

.inline-detail-image .img-loading {
    color: #667eea;
    padding: 20px;
    font-size: 12px;
    text-align: center;
}

/* 分析内容 */
.inline-detail-content {
    padding: 10px;
}

.inline-section {
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

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

.inline-section-title {
    background: #f8f9fa;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-section-title i {
    color: #667eea;
    font-size: 10px;
}

.inline-section-body {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    /* ⭐ 移除高度限制，完整显示内容 */
}

.inline-section-body p {
    margin: 0 0 5px 0;
}

.inline-section-body p:last-child {
    margin-bottom: 0;
}

.inline-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin: 2px;
}

/* 左侧面板滚动条美化 */
.tree-structure-panel::-webkit-scrollbar {
    width: 6px;
}

.tree-structure-panel::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.tree-structure-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.tree-node-detail .mcp-section-content p {
    margin: 0 0 6px 0;
}

.tree-node-detail .mcp-section-content p:last-child {
    margin-bottom: 0;
}

.tree-node-detail .mcp-section-content h3,
.tree-node-detail .mcp-section-content h4,
.tree-node-detail .mcp-section-content h5 {
    margin: 8px 0 5px 0;
    font-size: 12px;
    color: #495057;
}

.tree-node-detail .mcp-section-content .list-item {
    padding-left: 15px;
    position: relative;
    margin-bottom: 3px;
}

.tree-node-detail .mcp-section-content .list-item:before {
    content: "•";
    position: absolute;
    left: 3px;
    color: #667eea;
}

.tree-node-detail .mcp-section-content .list-item.numbered:before {
    content: none;
}

/* 特征标签（紧凑版） */
.tree-node-detail .feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tree-node-detail .feature-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* 位置信息区域 */
.tree-node-detail .location-section .mcp-section-title {
    background: linear-gradient(90deg, #f4e8fd 0%, #f8f9fa 100%);
}

.tree-node-detail .location-section .mcp-section-title i {
    color: #9b59b6;
}

/* 内容区域滚动条美化 */
.tree-node-detail .mcp-section-content::-webkit-scrollbar {
    width: 4px;
}

.tree-node-detail .mcp-section-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.tree-node-detail .mcp-section-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.tree-node-detail .mcp-section-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 选中节点的高亮效果 */
#treeSvg .tree-node.selected rect {
    filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.6)) !important;
}

/* 树详情内容滚动条美化 */
.tree-details-content::-webkit-scrollbar {
    width: 6px;
}

.tree-details-content::-webkit-scrollbar-track {
    background: #f8f8f8;
}

.tree-details-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.tree-details-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* 空状态 */
.tree-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    padding: 40px;
}

.tree-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.tree-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .tree-modal-content {
        width: 98%;
        height: 96%;
    }
    
    .tree-structure-panel {
        width: 30%;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .tree-modal-body {
        flex-direction: column;
    }
    
    .tree-structure-panel {
        width: 100%;
        max-width: none;
        /* ⭐ 移除高度限制 */
    }
    
    .tree-visualization-panel {
        flex: 1;
    }
}

/* ==================== 分析状态保存/加载按钮样式 ==================== */

/* 保存按钮 - 绿色渐变 */
#btnSaveState {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    transition: all 0.3s ease;
}

#btnSaveState:hover {
    background: linear-gradient(135deg, #0e8074 0%, #2dd968 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

/* 加载按钮 - 紫色渐变 */
#btnLoadState {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

#btnLoadState:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4193 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==================== 模式选择弹窗 - Apple风格白色极简 ==================== */
.mode-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-selection-modal.hidden {
    display: none;
}

.mode-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}

.mode-selection-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 24px;
    padding: 50px 60px;
    max-width: 820px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mode-selection-welcome {
    text-align: center;
    margin-bottom: 16px;
}

.mode-selection-welcome h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mode-selection-header {
    text-align: center;
    margin-bottom: 40px;
}

.mode-selection-header h2 {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

.mode-selection-header h2 i {
    color: #86868b;
    font-size: 20px;
}

.mode-selection-header p {
    color: #86868b;
    font-size: 17px;
    margin: 0;
    font-weight: 400;
}

.mode-selection-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 18px;
    padding: 32px 28px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-align: center;
}

.mode-card:hover {
    border-color: #0071e3;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.12);
}

.mode-card .mode-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #f5f5f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.05);
}

.mode-card .mode-icon i {
    font-size: 32px;
    color: #1d1d1f;
}

.mode-card h3 {
    color: #1d1d1f;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

.mode-card .mode-description {
    color: #6e6e73;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.mode-card .mode-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.mode-card .mode-features li {
    color: #6e6e73;
    font-size: 14px;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-card .mode-features li i {
    color: #34c759;
    font-size: 14px;
}

.mode-card[data-mode="ai"] .mode-icon {
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
}

.mode-card[data-mode="ai"] .mode-icon i {
    color: white;
}

.mode-card[data-mode="ai"]:hover {
    border-color: #007aff;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
}

.mode-card[data-mode="collaborative"] .mode-icon {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.mode-card[data-mode="collaborative"] .mode-icon i {
    color: white;
}

.mode-card[data-mode="collaborative"]:hover {
    border-color: #34c759;
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.15);
}

.mode-selection-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e5ea;
}

.mode-selection-footer .mode-hint {
    color: #86868b;
    font-size: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-selection-footer .mode-hint i {
    color: #86868b;
}

/* 当前模式指示器 - Apple风格 */
.current-mode-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    animation: indicatorFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}

@keyframes indicatorFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.current-mode-indicator.ai-mode {
    background: rgba(0, 122, 255, 0.9);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.3);
}

.current-mode-indicator.collaborative-mode {
    background: rgba(52, 199, 89, 0.9);
    color: white;
    box-shadow: 0 2px 12px rgba(52, 199, 89, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .mode-selection-body {
        grid-template-columns: 1fr;
    }
    
    .mode-selection-content {
        padding: 25px;
    }
}

/* ==================== 路径规划/进度面板 - 紧凑型优化 ==================== */
#analysisRoutePanel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

.route-header {
    padding: 12px 14px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e5ea;
    flex-shrink: 0;
}

.route-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.route-mode-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.route-mode-tag.auto-mode {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.route-mode-tag.collaborative-mode {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.route-back-btn {
    width: 28px;
    height: 28px;
    border: 0.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.route-back-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.route-slide-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-900);
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
}

.route-slide-info i {
    color: var(--primary-color);
    font-size: 12px;
}

.route-slide-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.route-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007aff 0%, #5856d6 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.route-progress-text {
    font-size: 11px;
    color: #86868b;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 脉冲点动画 - 类似 iOS "正在输入" 效果 */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dots .dot {
    width: 5px;
    height: 5px;
    background: #6366f1;
    border-radius: 50%;
    animation: typingPulse 1.4s ease-in-out infinite;
}

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

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

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

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.progress-message {
    color: #86868b;
}

.route-steps-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    background: #ffffff;
}

/* 自定义滚动条 - Apple风格 */
.route-steps-container::-webkit-scrollbar {
    width: 6px;
}

.route-steps-container::-webkit-scrollbar-track {
    background: transparent;
}

.route-steps-container::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 3px;
}

.route-steps-container::-webkit-scrollbar-thumb:hover {
    background: #8e8e93;
}

.route-steps-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 路径步骤卡片 - 紧凑型Apple风格 */
.route-step-card {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    background: #f5f5f7;
    color: var(--gray-900);
    border: none;
}

.route-step-card:hover {
    background: #e8e8ed;
    transform: translateX(2px);
}

.route-step-card.active {
    background: rgba(0, 122, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.3);
}

/* 红框步骤 */
.route-step-card.route-red {
    border-left-color: #ff3b30;
    background: rgba(255, 59, 48, 0.06);
}

.route-step-card.route-red:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* 蓝框步骤 */
.route-step-card.route-blue {
    border-left-color: #007aff;
    background: rgba(0, 122, 255, 0.06);
}

.route-step-card.route-blue:hover {
    background: rgba(0, 122, 255, 0.1);
}

/* 绿框步骤 */
.route-step-card.route-green {
    border-left-color: #34c759;
    background: rgba(52, 199, 89, 0.06);
}

.route-step-card.route-green:hover {
    background: rgba(52, 199, 89, 0.1);
}

/* 报告卡片样式 */
.route-step-card.report-card {
    border-left: 3px solid #af52de;
    background: rgba(175, 82, 222, 0.06);
}

.route-step-card.report-card:hover {
    background: rgba(175, 82, 222, 0.1);
}

.view-report-btn {
    width: 100%;
    padding: 8px 14px;
    margin-top: 6px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-report-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* 步骤卡片头部 */
.route-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.route-step-title {
    font-size: 12px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 5px;
}

.route-step-title .step-icon {
    font-size: 12px;
}

.route-step-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: #e5e5ea;
    color: #86868b;
    font-weight: 500;
}

.route-step-badge.completed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.route-step-badge.pending {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
}

.route-step-badge.waiting {
    background: rgba(0, 122, 255, 0.15);
    color: #007aff;
}

.route-step-badge.skipped {
    background: rgba(142, 142, 147, 0.15);
    color: #8e8e93;
}

/* 步骤卡片内容 - 完整显示（可折叠） */
.route-step-content {
    font-size: 11px;
    color: #6e6e73;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 协作模式下的操作按钮 */
.route-step-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.route-step-actions button {
    flex: 1;
    padding: 5px 8px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.route-step-actions .btn-accept {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.route-step-actions .btn-accept:hover {
    background: rgba(52, 199, 89, 0.25);
}

.route-step-actions .btn-skip {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
}

.route-step-actions .btn-skip:hover {
    background: rgba(255, 149, 0, 0.25);
}

.route-step-actions .btn-edit {
    background: rgba(0, 122, 255, 0.15);
    color: #007aff;
}

.route-step-actions .btn-edit:hover {
    background: rgba(0, 122, 255, 0.25);
}

/* 空状态 */
.route-empty-state {
    text-align: center;
    padding: 30px 16px;
    color: #86868b;
}

.route-empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.4;
    color: #c7c7cc;
}

.route-empty-state p {
    font-size: 13px;
    line-height: 1.5;
}

/* 点击高亮效果 */
.route-step-card.focused {
    animation: route-focus-pulse 0.5s ease;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.5);
}

@keyframes route-focus-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    100% {
        box-shadow: 0 0 0 6px rgba(102, 126, 234, 0);
    }
}

/* ==================== 树状层级结构 ==================== */

/* 树节点容器（红框父节点） */
.route-tree-node {
    margin-bottom: 8px;
}

/* 树节点头部（可点击展开/收起） */
.route-tree-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.08) 0%, rgba(255, 59, 48, 0.04) 100%);
    border-left: 3px solid #ff3b30;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.route-tree-header:hover {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.12) 0%, rgba(255, 59, 48, 0.06) 100%);
}

/* 展开/收起箭头 */
.route-tree-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    font-size: 10px;
}

.route-tree-header.collapsed .route-tree-toggle {
    transform: rotate(-90deg);
}

/* 树节点标题 */
.route-tree-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0; /* 允许flex子项收缩 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-tree-title .tree-icon {
    font-size: 12px;
    flex-shrink: 0;
}

/* 树节点状态标签 */
.route-tree-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    background: #e5e5ea;
    color: #86868b;
    font-weight: 500;
}

.route-tree-badge.completed {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.route-tree-badge.in-progress {
    background: rgba(0, 122, 255, 0.15);
    color: #007aff;
}

/* 子节点容器 */
.route-tree-children {
    margin-left: 12px;
    padding-left: 14px;
    border-left: 2px solid #e5e5ea;
    margin-top: 6px;
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.route-tree-header.collapsed + .route-tree-children {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}

/* 蓝框子节点容器 */
.route-tree-blue-node {
    margin-bottom: 6px;
}

.route-tree-blue-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 122, 255, 0.06);
    border-left: 2px solid #007aff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 6px;
}

.route-tree-blue-header:hover {
    background: rgba(0, 122, 255, 0.1);
}

.route-tree-blue-header.collapsed .route-tree-toggle {
    transform: rotate(-90deg);
}

.route-tree-blue-title {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #1d1d1f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* 蓝框内容 - 显示AI分析 */
.route-tree-blue-content {
    font-size: 12px;
    color: #444;
    margin: 8px 0 8px 10px;
    padding: 12px 14px;
    background: rgba(0, 122, 255, 0.04);
    border-left: 3px solid #007aff;
    border-radius: 6px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* 蓝框收起时隐藏内容和子节点 */
.route-tree-blue-header.collapsed + .route-tree-blue-content {
    display: none;
}

.route-tree-blue-header.collapsed + .route-tree-blue-content + .route-tree-green-children {
    display: none;
}

/* 蓝框收起时（无内容情况）直接隐藏子节点 */
.route-tree-blue-header.collapsed ~ .route-tree-green-children {
    display: none;
}

/* 绿框孙节点容器 */
.route-tree-green-children {
    margin-left: 10px;
    padding-left: 12px;
    border-left: 2px solid #e5e5ea;
    margin-top: 4px;
}

/* 绿框叶节点 */
.route-tree-green-item {
    padding: 6px 10px;
    background: rgba(52, 199, 89, 0.06);
    border-left: 2px solid #34c759;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.route-tree-green-item:hover {
    background: rgba(52, 199, 89, 0.1);
}

/* ⭐ 绿框节点的黄色高亮样式（点击WSI上的绿框时） */
.route-tree-green-item.roi-selected-glow {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 193, 7, 0.25) 100%) !important;
    border: 2px solid #FFD700 !important;
    border-left: 4px solid #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 30px rgba(255, 193, 7, 0.3) !important;
    transform: translateX(4px);
    animation: glow-pulse 1.5s ease-in-out infinite;
}

.route-tree-green-item.roi-selected-glow .route-tree-green-title {
    color: #B8860B !important;
    font-weight: bold;
}

.route-tree-green-item:last-child {
    margin-bottom: 0;
}

.route-tree-green-title {
    font-size: 11px;
    font-weight: 500;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 4px;
}

.route-tree-green-content {
    font-size: 10px;
    color: #6e6e73;
    margin-top: 4px;
    padding: 4px 6px;
    background: rgba(52, 199, 89, 0.03);
    border-radius: 4px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 节点计数标签 */
.route-tree-count {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #f5f5f7;
    color: #86868b;
    margin-left: auto;
}

/* 空子节点提示 */
.route-tree-empty {
    padding: 8px 12px;
    color: #c7c7cc;
    font-size: 11px;
    font-style: italic;
}

/* ==================== 红框内容区域 ==================== */

/* 红框内容 - 展开时显示 */
.route-tree-content {
    margin: 8px 0 8px 26px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 59, 48, 0.04);
    border-left: 3px solid #ff3b30;
    border-radius: 6px;
}

/* 收起时隐藏内容 */
.route-tree-header.collapsed + .route-tree-content {
    display: none;
}

.route-tree-header.collapsed + .route-tree-content + .route-tree-children {
    display: none;
}

/* ============================================================
   协作模式 (Collaborative Mode) - Apple 简洁风格
   使用 .layout-mode-collab 作为父容器类名区分
   ============================================================ */

/* 协作模式容器背景 - Apple 简洁浅色风格 */
.layout-mode-collab {
    background: #f5f5f7;
}

.layout-mode-collab .route-header {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-bottom: 1px solid #e5e5ea;
}

.layout-mode-collab .route-slide-info {
    color: #1d1d1f;
}

.layout-mode-collab .route-slide-info i {
    color: #34C759;
}

.layout-mode-collab .route-progress-bar {
    background: #e5e5ea;
}

.layout-mode-collab .route-progress-fill {
    background: linear-gradient(90deg, #34C759 0%, #30D158 100%);
}

.layout-mode-collab .route-progress-text {
    color: #86868b;
}

.layout-mode-collab .route-steps-container {
    background: transparent;
}

.layout-mode-collab .route-steps-list {
    gap: 12px;
    padding: 16px;
}

/* ============================================================
   协作模式 - 交互式工作台任务卡片样式
   ============================================================ */

/* 任务卡片容器 - Apple 简洁风格 */
.layout-mode-collab .collab-task-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e5ea;
    border-left: 4px solid #FF9500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    overflow: hidden;
    margin-bottom: 10px;
}

.layout-mode-collab .collab-task-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.layout-mode-collab .collab-task-card.active {
    border-left-color: #34C759;
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.3), 0 4px 12px rgba(52, 199, 89, 0.15);
}

/* ⭐ 点击中间图框时，左侧对应解读的发光黄色高亮 */
.roi-selected-glow,
.route-tree-node.roi-selected-glow,
.route-tree-blue-node.roi-selected-glow,
.route-tree-green-item.roi-selected-glow,
.route-tree-header.roi-selected-glow,
.route-tree-blue-header.roi-selected-glow,
.collab-task-card.roi-selected-glow,
.route-step-card.roi-selected-glow,
.tree-item.roi-selected-glow,
.tree-branch.roi-selected-glow,
.region-item.roi-selected-glow,
.collab-tree-node.roi-selected-glow {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 193, 7, 0.25) 100%) !important;
    border: 3px solid #FFD700 !important;
    border-left: 8px solid #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 193, 7, 0.4), inset 0 0 15px rgba(255, 215, 0, 0.2) !important;
    transform: translateX(4px);
    transition: all 0.3s ease;
    animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 193, 7, 0.4), inset 0 0 15px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 193, 7, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.3);
    }
}

.roi-selected-glow .route-tree-header,
.roi-selected-glow .route-tree-blue-header,
.roi-selected-glow .collab-card-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
}

.roi-selected-glow .route-tree-content,
.roi-selected-glow .route-tree-blue-content {
    border-left: 4px solid #FFD700 !important;
    background: rgba(255, 215, 0, 0.08) !important;
}

/* ⭐ Patient Level 分析树节点的高亮样式 - 参考单张WSI自动模式 */
.tree-item.roi-selected-glow {
    border-radius: 6px;
    margin: 2px 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 193, 7, 0.25) 100%) !important;
    border: 2px solid #FFD700 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
    transform: translateX(4px);
    animation: tree-item-glow 1.5s ease-in-out infinite;
}

@keyframes tree-item-glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
    }
}

.tree-item.roi-selected-glow .box-label {
    font-weight: bold;
    color: #B8860B !important;
}

/* ⭐ 整个分支高亮 */
.tree-branch.roi-selected-glow {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%) !important;
    border-radius: 8px;
    padding: 4px;
    margin: 4px 0;
}

/* ⭐ 观察结果高亮样式 */
.tree-item.roi-selected-glow + .box-observation,
.box-observation.roi-selected-glow {
    border-color: #FFD700 !important;
    border-left-width: 4px !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3) !important;
}

/* ⭐ Bug修复：选中框时的紫色高亮样式（与右侧确认卡片一致） */
/* ⭐ 大幅加深颜色使选中状态非常明显 */
.layout-mode-collab .collab-task-card.active-viewing,
.layout-mode-collab .collab-task-card.card-active,
.collab-task-card.active-viewing,
.collab-task-card.card-active,
.route-step-card.active-viewing,
.route-step-card.card-active {
    border-left-color: #7C3AED !important;
    border-left-width: 8px !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4) 0%, rgba(124, 58, 237, 0.25) 100%) !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.6), 0 8px 24px rgba(124, 58, 237, 0.5) !important;
    transform: translateX(6px);
    border: 3px solid #7C3AED !important;
    border-left: 8px solid #7C3AED !important;
}

.layout-mode-collab .collab-task-card.active-viewing .collab-card-header,
.collab-task-card.active-viewing .collab-card-header,
.collab-task-card.card-active .collab-card-header {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5) 0%, rgba(124, 58, 237, 0.3) 100%) !important;
}

.layout-mode-collab .collab-task-card.active-viewing .collab-card-title,
.collab-task-card.active-viewing .collab-card-title,
.collab-task-card.card-active .collab-card-title {
    color: #5B21B6 !important;
    font-weight: 800 !important;
}

.layout-mode-collab .collab-task-card.active-viewing .collab-card-status,
.collab-task-card.active-viewing .collab-card-status,
.collab-task-card.card-active .collab-card-status {
    color: #5B21B6 !important;
    font-weight: 700 !important;
}

.layout-mode-collab .collab-task-card.active-viewing .collab-card-count,
.collab-task-card.active-viewing .collab-card-count,
.collab-task-card.card-active .collab-card-count {
    background: rgba(124, 58, 237, 0.3) !important;
    color: #5B21B6 !important;
    font-weight: 600;
}

/* ⭐ 自动模式下的卡片激活样式 */
.route-step-card.active-viewing,
.route-step-card.card-active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%) !important;
}

.route-step-card.active-viewing .route-step-title,
.route-step-card.card-active .route-step-title {
    color: #5B21B6 !important;
    font-weight: 700 !important;
}

/* 状态边框颜色 */
.layout-mode-collab .collab-task-card.status-pending {
    border-left-color: #f6ad55;
}

.layout-mode-collab .collab-task-card.status-active {
    border-left-color: #4299e1;
}

.layout-mode-collab .collab-task-card.status-done {
    border-left-color: #48bb78;
    opacity: 0.85;
}

.layout-mode-collab .collab-task-card.status-skipped {
    border-left-color: #86868b;
    opacity: 0.6;
}

/* 卡片头部（可点击区域） */
.layout-mode-collab .collab-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.layout-mode-collab .collab-card-header:hover {
    background: #f7fafc;
}

/* 卡片标题 */
.layout-mode-collab .collab-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.layout-mode-collab .collab-card-title .level-icon {
    font-size: 16px;
}

.layout-mode-collab .collab-card-title .title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* 卡片状态文本 */
.layout-mode-collab .collab-card-status {
    font-size: 12px;
    color: #718096;
    white-space: nowrap;
}

/* 区域计数 */
.layout-mode-collab .collab-card-count {
    font-size: 11px;
    color: #86868b;
    padding: 0 14px 8px;
    border-bottom: 1px solid #e5e5ea;
}

/* ============================================================
   操作按钮组样式
   ============================================================ */
.layout-mode-collab .collab-btn-group {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #f7fafc;
}

.layout-mode-collab .collab-mini-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 6px;
    border: 1px solid #e5e5ea;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #1d1d1f;
}

.layout-mode-collab .collab-mini-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.layout-mode-collab .collab-mini-btn:active {
    transform: translateY(0);
}

.layout-mode-collab .collab-mini-btn i {
    font-size: 11px;
}

/* 接受按钮 */
.layout-mode-collab .collab-btn-accept {
    color: #38a169;
    border-color: #c6f6d5;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.layout-mode-collab .collab-btn-accept:hover {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border-color: #9ae6b4;
}

/* 调整按钮 */
.layout-mode-collab .collab-btn-edit {
    color: #d69e2e;
    border-color: #faf089;
    background: linear-gradient(135deg, #fffff0 0%, #fefcbf 100%);
}

.layout-mode-collab .collab-btn-edit:hover {
    background: linear-gradient(135deg, #fefcbf 0%, #faf089 100%);
    border-color: #f6e05e;
}

/* 增加按钮 */
.layout-mode-collab .collab-btn-add {
    color: #2b6cb0;
    border-color: #bee3f8;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
}

.layout-mode-collab .collab-btn-add:hover {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    border-color: #90cdf4;
}

/* 删除按钮 */
.layout-mode-collab .collab-btn-delete {
    color: #c53030;
    border-color: #fed7d7;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.layout-mode-collab .collab-btn-delete:hover {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border-color: #feb2b2;
}

/* 确认调整按钮 */
.layout-mode-collab .collab-btn-confirm-edit {
    color: #2b6cb0;
    border-color: #bee3f8;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
}

.layout-mode-collab .collab-btn-confirm-edit:hover {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
}

/* 取消按钮 */
.layout-mode-collab .collab-btn-cancel-edit {
    color: #c53030;
    border-color: #fed7d7;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.layout-mode-collab .collab-btn-cancel-edit:hover {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

/* ============================================================
   完成状态样式
   ============================================================ */
.layout-mode-collab .collab-task-card.status-done .collab-card-title {
    color: #718096;
}

.layout-mode-collab .collab-task-card.status-done .collab-card-title .title-text {
    text-decoration: line-through;
    text-decoration-color: #68d391;
}

.layout-mode-collab .collab-task-card.status-skipped .collab-card-title {
    color: #86868b;
}

.layout-mode-collab .collab-task-card.status-skipped .collab-card-title .title-text {
    text-decoration: line-through;
    text-decoration-color: #cbd5e0;
}

/* ============================================================
   其他协作模式样式
   ============================================================ */

/* 空状态 */
.layout-mode-collab .route-empty-state {
    color: #86868b;
}

.layout-mode-collab .route-empty-state i {
    color: #34C759;
    opacity: 0.8;
}

/* 面板标题 - Apple 风格 */
.layout-mode-collab .collab-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5ea;
    margin: 0;
}

.layout-mode-collab .collab-panel-title i {
    color: #34C759;
}

/* 卡片闪烁效果 */
.layout-mode-collab .collab-task-card.flash-highlight {
    animation: card-flash 0.6s ease;
}

/* ⭐ Patient Level 分析树的闪烁高亮效果 */
.tree-item.flash-highlight,
.clickable-roi.flash-highlight {
    animation: tree-node-flash 0.8s ease;
}

@keyframes tree-node-flash {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 193, 7, 0.25) 100%);
    }
    25%, 75% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 193, 7, 0.8);
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.6) 0%, rgba(255, 193, 7, 0.4) 100%);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 193, 7, 1);
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.7) 0%, rgba(255, 193, 7, 0.5) 100%);
    }
}

.tree-branch.flash-highlight {
    animation: tree-branch-flash 0.8s ease;
}

@keyframes tree-branch-flash {
    0%, 100% {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    }
    50% {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 193, 7, 0.2) 100%);
    }
}

@keyframes card-flash {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }
    50% { 
        box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.5), 0 4px 16px rgba(72, 187, 120, 0.3);
    }
}

/* 卡片淡出效果（确认完成后自动删除） */
.layout-mode-collab .collab-task-card.fade-out {
    animation: card-fade-out 0.3s ease forwards;
}

@keyframes card-fade-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* 自动模式保持默认样式 (显式声明，保证隔离) */
.layout-mode-auto {
    /* 保持默认背景 - 添加占位属性避免空规则集警告 */
    position: relative;
}

.layout-mode-auto .route-step-card {
    /* 保持原有日志流样式，不做任何改动 - 添加占位属性避免空规则集警告 */
    position: relative;
}

/* ============================================================
   聊天区域闪烁高亮效果（协作模式点击左侧卡片时联动）
   ============================================================ */
.message-item.flash-highlight,
.chat-message.flash-highlight,
.confirmation-card.flash-highlight {
    animation: chat-message-flash 0.8s ease;
}

@keyframes chat-message-flash {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    25%, 75% {
        background-color: rgba(100, 210, 255, 0.15);
        box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.4);
    }
}

/* ============================================================
   协作模式 - 交互式工作台卡片样式（新版）
   ============================================================ */

/* 卡片头部区域 */
.layout-mode-collab .collab-task-card .collab-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px 12px 0 0;
    transition: background 0.2s ease;
}

.layout-mode-collab .collab-task-card:hover .collab-card-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* 卡片标题 */
.layout-mode-collab .collab-task-card .collab-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}

.layout-mode-collab .collab-task-card .collab-card-title .level-icon {
    font-size: 16px;
}

.layout-mode-collab .collab-task-card .collab-card-title .title-text {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片状态文字 */
.layout-mode-collab .collab-task-card .collab-card-status {
    font-size: 12px;
    font-weight: 500;
    color: #718096;
    flex-shrink: 0;
}

.layout-mode-collab .collab-task-card.status-pending .collab-card-status {
    color: #dd6b20;
}

.layout-mode-collab .collab-task-card.status-active .collab-card-status {
    color: #3182ce;
}

.layout-mode-collab .collab-task-card.status-done .collab-card-status {
    color: #38a169;
}

.layout-mode-collab .collab-task-card.status-skipped .collab-card-status {
    color: #a0aec0;
}

/* 子区域计数 */
.layout-mode-collab .collab-task-card .collab-card-count {
    padding: 6px 14px;
    font-size: 11px;
    color: #718096;
    background: #f7fafc;
}

/* ============================================================
   协作模式 - 操作按钮组样式
   ============================================================ */

.layout-mode-collab .collab-btn-group {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 0 0 12px 12px;
}

.layout-mode-collab .collab-mini-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.layout-mode-collab .collab-mini-btn i {
    font-size: 11px;
}

/* 接受按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-accept {
    color: #22543d;
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border-color: #68d391;
}

.layout-mode-collab .collab-mini-btn.collab-btn-accept:hover {
    background: linear-gradient(135deg, #9ae6b4 0%, #68d391 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(72, 187, 120, 0.35);
}

/* 调整按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-edit {
    color: #744210;
    background: linear-gradient(135deg, #fefcbf 0%, #faf089 100%);
    border-color: #ecc94b;
}

.layout-mode-collab .collab-mini-btn.collab-btn-edit:hover {
    background: linear-gradient(135deg, #faf089 0%, #ecc94b 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(236, 201, 75, 0.35);
}

/* 增加按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-add {
    color: #2b6cb0;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-color: #90cdf4;
}

.layout-mode-collab .collab-mini-btn.collab-btn-add:hover {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(66, 153, 225, 0.35);
}

/* 删除按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-delete {
    color: #c53030;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-color: #fc8181;
}

.layout-mode-collab .collab-mini-btn.collab-btn-delete:hover {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(245, 101, 101, 0.35);
}

/* 确认调整按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-confirm-edit {
    color: #22543d;
    background: linear-gradient(135deg, #c6f6d5 0%, #68d391 100%);
    border-color: #48bb78;
}

.layout-mode-collab .collab-mini-btn.collab-btn-confirm-edit:hover {
    background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    box-shadow: 0 3px 8px rgba(72, 187, 120, 0.4);
}

/* 取消调整按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-cancel-edit,
.layout-mode-collab .collab-mini-btn.collab-btn-cancel {
    color: #742a2a;
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    border-color: #f56565;
}

.layout-mode-collab .collab-mini-btn.collab-btn-cancel-edit:hover,
.layout-mode-collab .collab-mini-btn.collab-btn-cancel:hover {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    box-shadow: 0 3px 8px rgba(245, 101, 101, 0.35);
}

/* 完成增加/删除按钮 */
.layout-mode-collab .collab-mini-btn.collab-btn-finish-add,
.layout-mode-collab .collab-mini-btn.collab-btn-finish-delete {
    color: #22543d;
    background: linear-gradient(135deg, #c6f6d5 0%, #68d391 100%);
    border-color: #48bb78;
}

.layout-mode-collab .collab-mini-btn.collab-btn-finish-add:hover,
.layout-mode-collab .collab-mini-btn.collab-btn-finish-delete:hover {
    background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    box-shadow: 0 3px 8px rgba(72, 187, 120, 0.4);
}

/* 编辑模式下的卡片高亮 */
.collab-task-card.editing-mode {
    border: 2px solid #4299e1;
    box-shadow: 0 0 12px rgba(66, 153, 225, 0.4);
}

.collab-task-card.editing-mode.add-mode {
    border-color: #4299e1;
    box-shadow: 0 0 12px rgba(66, 153, 225, 0.4);
}

.collab-task-card.editing-mode.delete-mode {
    border-color: #f56565;
    box-shadow: 0 0 12px rgba(245, 101, 101, 0.4);
}

/* 按钮禁用状态 */
.layout-mode-collab .collab-mini-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================================
   协作模式 - 卡片状态边框颜色（覆盖旧样式）
   ============================================================ */

.layout-mode-collab .collab-task-card {
    border-left: 5px solid #e2e8f0;
}

.layout-mode-collab .collab-task-card.status-pending {
    border-left-color: #ed8936;
}

.layout-mode-collab .collab-task-card.status-active {
    border-left-color: #4299e1;
}

.layout-mode-collab .collab-task-card.status-done {
    border-left-color: #48bb78;
}

.layout-mode-collab .collab-task-card.status-skipped {
    border-left-color: #a0aec0;
}

/* 完成状态的卡片淡化 */
.layout-mode-collab .collab-task-card.status-done,
.layout-mode-collab .collab-task-card.status-skipped {
    opacity: 0.75;
}

.layout-mode-collab .collab-task-card.status-done:hover,
.layout-mode-collab .collab-task-card.status-skipped:hover {
    opacity: 1;
}

/* 右侧确认卡片已处理状态 */
.confirmation-card.processed {
    opacity: 0.7;
    border-left-color: #48bb78;
}

.confirmation-card .confirmation-status {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #38a169;
}

/* ============================================================
   协作模式 - 分析结果操作按钮（确认/编辑/重新生成）
   ============================================================ */

.result-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.result-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-btn-accept {
    background: var(--secondary-color);
    color: white;
}

.result-btn-accept:hover {
    background: #059669;
    transform: translateY(-1px);
}

.result-btn-edit {
    background: var(--primary-color);
    color: white;
}

.result-btn-edit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.result-btn-reject {
    background: var(--gray-500);
    color: white;
}

.result-btn-reject:hover {
    background: var(--gray-600);
    transform: translateY(-1px);
}

/* 状态标记 */
.result-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.result-accepted {
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary-color);
}

.result-edited {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-color);
}

.result-reanalyzing {
    background: rgba(249, 115, 22, 0.15);
    color: var(--warning-color);
}

/* 编辑模式容器 */
.result-edit-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-edit-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    background: var(--gray-50);
    transition: border-color 0.2s ease;
}

.result-edit-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.result-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.result-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-edit-save {
    background: var(--secondary-color);
    color: white;
}

.result-edit-save:hover {
    background: #059669;
}

.result-edit-cancel {
    background: var(--gray-400);
    color: white;
}

.result-edit-cancel:hover {
    background: var(--gray-500);
}

/* 左侧卡片已确认/已编辑状态 */
.route-step-card.result-confirmed {
    border-left-color: var(--secondary-color) !important;
}

.route-step-card.result-edited {
    border-left-color: var(--primary-color) !important;
}

.collab-task-card.result-confirmed {
    border-left-color: var(--secondary-color) !important;
}

.collab-task-card.result-edited {
    border-left-color: var(--primary-color) !important;
}

/* ⭐ 当前需要确认的卡片高亮样式 */
.collab-task-card.current-confirm {
    border: 2px solid #ff6b35 !important;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, #fff5f0 0%, #ffffff 100%);
}

.collab-task-card.current-confirm .collab-card-status {
    color: #ff6b35;
    font-weight: bold;
}

/* ⭐ 高亮闪烁动画 */
.collab-task-card.highlight-pulse {
    animation: card-pulse 0.5s ease-in-out 3;
}

@keyframes card-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 107, 53, 0.8); }
}

/* ⭐ 确认全部蓝框按钮容器 */
.confirm-all-blue-container {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
    animation: slideInFromTop 0.3s ease-out;
}

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

.confirm-all-blue-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.confirm-all-blue-header.confirmed {
    color: #2e7d32;
}

.confirm-all-icon {
    font-size: 1.4em;
}

.confirm-all-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #2e7d32;
}

.confirm-all-count {
    background: #4CAF50;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.confirm-all-hint {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 12px;
    padding-left: 28px;
}

.confirm-all-blue-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.confirm-all-blue-btn:hover {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.confirm-all-blue-btn:active {
    transform: translateY(0);
}

.confirm-all-blue-btn i {
    font-size: 1.1em;
}

/* ⭐ 已处理但待统一确认的卡片样式 */
.collab-task-card.processed-pending {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-left: 4px solid #4CAF50;
    opacity: 0.9;
}

.collab-task-card.processed-pending .collab-card-status {
    color: #388E3C;
    font-weight: bold;
}

.collab-task-card.processed-pending.status-skipped {
    background: linear-gradient(135deg, #fff3e0 0%, #fff 100%);
    border-left: 4px solid #FF9800;
}

.collab-task-card.processed-pending.status-skipped .collab-card-status {
    color: #E65100;
}

/* ⭐ 确认全部绿框按钮容器 */
.confirm-all-green-container {
    background: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%);
    border: 2px solid #66BB6A;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.2);
    animation: slideInFromTop 0.3s ease-out;
}

.confirm-all-green-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.confirm-all-green-header.confirmed {
    color: #2e7d32;
}

.confirm-all-green-container .confirm-all-icon {
    font-size: 1.4em;
}

.confirm-all-green-container .confirm-all-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #2e7d32;
}

.confirm-all-green-container .confirm-all-count {
    background: #66BB6A;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.confirm-all-green-container .confirm-all-hint {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 12px;
    padding-left: 28px;
}

.confirm-all-green-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.3);
}

.confirm-all-green-btn:hover {
    background: linear-gradient(135deg, #57a85b 0%, #388E3C 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.4);
}

.confirm-all-green-btn:active {
    transform: translateY(0);
}

.confirm-all-green-btn i {
    font-size: 1.1em;
}

/* ==================== PathCopilot 确认对话框样式 ==================== */

/* 模态框容器 */
.copilot-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 背景遮罩 */
.copilot-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 对话框内容 */
.copilot-confirm-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: copilotModalIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

/* 对话框头部 */
.copilot-confirm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    position: relative;
}

.copilot-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.copilot-confirm-icon.blue-frame {
    background: rgba(0, 102, 255, 0.3);
}

.copilot-confirm-icon.green-frame {
    background: rgba(0, 204, 0, 0.3);
}

.copilot-confirm-title-group {
    flex: 1;
}

.copilot-confirm-title-group h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.copilot-confirm-step {
    font-size: 13px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 12px;
}

.copilot-confirm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.copilot-confirm-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 对话框主体 */
.copilot-confirm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* AI思考过程区域 */
.copilot-thinking {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #4f46e5;
    font-weight: 600;
    font-size: 14px;
}

.thinking-header i {
    font-size: 16px;
}

.thinking-content {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

/* 建议内容区域 */
.copilot-proposal {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.proposal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #059669;
    font-weight: 600;
    font-size: 14px;
}

.proposal-header i {
    font-size: 16px;
}

.proposal-content {
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.proposal-content .region-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.proposal-content .region-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
}

.proposal-content .region-item i {
    color: #4f46e5;
}

.proposal-content .region-item .region-index {
    background: #4f46e5;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.proposal-content .region-item.blue-region .region-index {
    background: #0066FF;
}

.proposal-content .region-item.green-region .region-index {
    background: #00CC00;
}

/* 预览区域 */
.copilot-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #7c3aed;
    font-weight: 600;
    font-size: 14px;
}

.preview-header i {
    font-size: 16px;
}

.preview-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.preview-thumbnail:hover {
    border-color: #4f46e5;
    transform: scale(1.05);
}

.preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumbnail .thumbnail-index {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.preview-empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 13px;
}

/* 对话框底部 */
.copilot-confirm-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
}

.footer-hint i {
    font-size: 14px;
}

.footer-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.copilot-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.copilot-btn i {
    font-size: 14px;
}

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

.copilot-btn-skip:hover {
    background: #e2e8f0;
    color: #475569;
}

.copilot-btn-edit {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.copilot-btn-edit:hover {
    background: #fde68a;
}

.copilot-btn-accept {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.copilot-btn-accept:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.copilot-btn-accept:active {
    transform: translateY(0);
}

/* 不同类型的对话框颜色主题 */
.copilot-confirm-modal.blue-theme .copilot-confirm-header {
    background: linear-gradient(135deg, #0066FF 0%, #2563eb 100%);
}

.copilot-confirm-modal.blue-theme .copilot-btn-accept {
    background: linear-gradient(135deg, #0066FF 0%, #2563eb 100%);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.copilot-confirm-modal.blue-theme .copilot-btn-accept:hover {
    background: linear-gradient(135deg, #0052cc 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.copilot-confirm-modal.green-theme .copilot-confirm-header {
    background: linear-gradient(135deg, #00CC00 0%, #059669 100%);
}

.copilot-confirm-modal.green-theme .copilot-btn-accept {
    background: linear-gradient(135deg, #00CC00 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(0, 204, 0, 0.3);
}

.copilot-confirm-modal.green-theme .copilot-btn-accept:hover {
    background: linear-gradient(135deg, #00b300 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(0, 204, 0, 0.4);
}

.copilot-confirm-modal.report-theme .copilot-confirm-header {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
}

/* 响应式设计 */
@media (max-width: 640px) {
    .copilot-confirm-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .copilot-confirm-header {
        padding: 16px 20px;
    }
    
    .copilot-confirm-body {
        padding: 16px 20px;
    }
    
    .copilot-confirm-footer {
        padding: 12px 20px;
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-hint {
        order: 2;
    }
    
    .footer-actions {
        order: 1;
        width: 100%;
        justify-content: stretch;
    }
    
    .copilot-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================
   区域截图询问功能样式
   ============================================================ */

/* 截图按钮激活状态 */
#screenshotAskBtn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 截图选择覆盖层 */
.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.1);
}

/* 截图选择框 */
.screenshot-selection {
    position: absolute;
    border: 2px dashed #667eea;
    background: rgba(102, 126, 234, 0.15);
    pointer-events: none;
    z-index: 1001;
}

/* 截图预览区域 */
.screenshot-preview {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
}

.screenshot-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
}

.screenshot-preview-header i {
    font-size: 14px;
}

.screenshot-preview-header span {
    flex: 1;
}

.clear-screenshot-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-screenshot-btn:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.screenshot-preview-image {
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 1px solid #e0e0e0;
}

.screenshot-preview-image img {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

/* 截图提示 */
.screenshot-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1002;
    text-align: center;
    pointer-events: none;
}

.screenshot-hint i {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
    color: #667eea;
}

/* 截图模式下的视图容器 */
.wsi-viewer.screenshot-mode,
#openseadragon-viewer.screenshot-mode {
    cursor: crosshair !important;
}

#openseadragon-viewer.screenshot-mode::after {
    content: '拖拽选择区域进行截图';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.7; }
}

/* 截图选择动态覆盖层 */
.screenshot-selection-overlay {
    position: absolute;
    border: 2px dashed #667eea;
    background: rgba(102, 126, 234, 0.2);
    pointer-events: none;
    z-index: 1001;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    transition: none;
}

/* 聊天消息中的截图缩略图 */
.message-screenshot {
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.message-screenshot .screenshot-thumbnail {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    background: #f8f8f8;
}

.user-message .message-screenshot {
    max-width: 240px;
    margin-left: auto;
}

.assistant-message .message-screenshot {
    max-width: 280px;
}

/* 截图模式激活时的按钮样式 */
#screenshotAskBtn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 📷 导出截图按钮样式 */
#exportScreenshotBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

#exportScreenshotBtn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

#exportScreenshotBtn:active {
    transform: scale(0.95);
}

/* ==================== 五阶段协作模式样式 ==================== */

/* 阶段结果卡片 */
.phase-result-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.phase-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.phase-result-card.editing {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.02) 100%);
}

/* 阶段头部 */
.phase-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.phase-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-title {
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.phase-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.phase-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.phase-status.confirmed {
    background: #d1fae5;
    color: #059669;
}

.phase-status.modified {
    background: #dbeafe;
    color: #2563eb;
}

.phase-status.analyzing {
    background: #fef3c7;
    color: #d97706;
}

.phase-status.analyzing i {
    margin-right: 4px;
}

/* 分析中卡片样式 */
.analyzing-card {
    border-left-color: #f59e0b !important;
    animation: analyzingPulse 1.5s ease-in-out infinite;
}

.analyzing-content {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
    border-radius: 8px;
}

@keyframes analyzingPulse {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
    }
    50% { 
        opacity: 0.85; 
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
    }
}

/* Reasoning 区域 */
.phase-reasoning {
    margin-bottom: 14px;
}

.phase-reasoning h4,
.phase-plan h4,
.phase-regions h4,
.phase-subagents h4,
.phase-report h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.phase-reasoning h4 i { color: #8b5cf6; }
.phase-plan h4 i { color: #3b82f6; }
.phase-regions h4 i { color: #ef4444; }
.phase-subagents h4 i { color: #6366f1; }
.phase-report h4 i { color: #f59e0b; }

.phase-reasoning p {
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
    background: rgba(139, 92, 246, 0.05);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

/* Plan 区域 */
.phase-plan {
    margin-bottom: 14px;
}

.phase-plan ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.phase-plan li {
    font-size: 13px;
    color: #374151;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    position: relative;
    padding-left: 24px;
}

.phase-plan li::before {
    content: '→';
    position: absolute;
    left: 8px;
    color: #3b82f6;
    font-weight: bold;
}

/* 区域列表 */
.phase-regions {
    margin-bottom: 14px;
}

.regions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.region-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.region-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.region-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.region-id {
    font-weight: 600;
    color: #1f2937;
    min-width: 40px;
}

.region-reason {
    font-size: 12px;
    color: #6b7280;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SubAgent 结果列表 */
.phase-subagents {
    margin-bottom: 14px;
}

.subagent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subagent-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}

.subagent-item.success {
    border-left-color: #22c55e;
}

.subagent-item.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.subagent-id {
    font-weight: 600;
    color: #1f2937;
    min-width: 50px;
}

.subagent-findings {
    font-size: 12px;
    color: #6b7280;
    flex: 1;
    line-height: 1.5;
}

/* ⭐ 协作模式树状结构容器 (完全参照自动模式) */
.collab-tree-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

/* 协作模式的树节点样式 - 继承自动模式 */
.collab-tree-node {
    border-radius: 8px;
    overflow: hidden;
}

.collab-tree-node .route-tree-header {
    padding: 10px 12px;
    background: rgba(255, 59, 48, 0.06);
    border-left: 4px solid #ff3b30;
}

.collab-tree-node .route-tree-content {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

/* 协作模式 Phase 2-4 的 route-tree-count 样式 */
.collab-tree-node .route-tree-count {
    margin-left: 8px;
    font-size: 11px;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Phase AI 输出区域 (Phase 1) */
.phase-ai-output {
    margin: 12px 0;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ai-output-label {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-output-label i {
    font-size: 14px;
}

.ai-output-content {
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-output-content strong {
    color: #1f2937;
}

/* 报告区域 */
.phase-report {
    margin-bottom: 14px;
}

.report-content {
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
    background: rgba(245, 158, 11, 0.05);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    max-height: 300px;
    overflow-y: auto;
}

.report-content h5 {
    color: #1f2937;
    margin: 12px 0 6px 0;
    font-size: 14px;
}

.report-content p {
    margin: 6px 0;
}

.report-content li {
    margin: 4px 0;
}

/* 编辑确认按钮 */
.edit-confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.edit-confirm-buttons button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

/* ⭐ Apple Style 保存按钮 */
.btn-save-edit {
    background: #007AFF;  /* Apple Blue */
    color: white;
}

.btn-save-edit:hover {
    background: #0066DD;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

/* ⭐ Apple Style 取消按钮 */
.btn-cancel-edit {
    background: #F5F5F7;
    color: #1d1d1f;
}

.btn-cancel-edit:hover {
    background: #E8E8ED;
}

/* ⭐ Apple Style 右侧聊天确认消息样式 */
.phase-confirm-message .message-content {
    background: rgba(0, 122, 255, 0.06);
    border: 0.5px solid rgba(0, 122, 255, 0.15);
}

.phase-confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.phase-confirm-buttons button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-execute {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-execute:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-modify {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-modify:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.phase-confirm-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ⭐ Phase 5 完成状态按钮样式 */
.phase-complete-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.phase-complete-actions button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-view-report {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-view-report:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-export-report {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.btn-export-report:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ⭐ Phase 5 审核流程按钮样式 */
.phase5-review-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.phase5-review-actions button {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

/* ⭐ Apple Style 确认报告按钮 */
.btn-confirm-report {
    background: #007AFF;  /* Apple Blue */
    color: white;
}

.btn-confirm-report:hover:not(:disabled) {
    background: #0066DD;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

/* ⭐ Apple Style 修改报告按钮 */
.btn-modify-report {
    background: #34C759;  /* Apple Green */
    color: white;
}

.btn-modify-report:hover:not(:disabled) {
    background: #2DB84D;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.25);
}

/* ⭐ Apple Style 查看HTML报告按钮 */
.btn-view-html-report {
    background: #5856D6;  /* Apple Purple */
    color: white;
}

.btn-view-html-report:hover:not(:disabled) {
    background: #4B49B6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 86, 214, 0.25);
}

.phase5-review-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Phase 5 确认后的按钮样式 */
.btn-view-report-final,
.btn-export-report-final {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-view-report-final {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-view-report-final:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-export-report-final {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.btn-export-report-final:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-view-report-final:disabled,
.btn-export-report-final:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Phase 5 报告编辑器样式 */
.phase5-report-editor {
    width: 100%;
    min-height: 300px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    padding: 12px;
    border: 2px solid #6366f1;
    border-radius: 8px;
    background: #fafafa;
    resize: vertical;
    white-space: pre-wrap;
}

.phase5-report-editor:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Phase 5 编辑选项样式 */
.phase5-edit-options {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

.phase5-edit-options .edit-options-header {
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 12px;
    font-size: 14px;
}

.phase5-edit-options .edit-options-header i {
    margin-right: 6px;
}

.phase5-edit-options .edit-options-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.phase5-edit-options .edit-options-buttons button {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.phase5-edit-options .btn-direct-edit {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.phase5-edit-options .btn-direct-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.phase5-edit-options .btn-quote-to-chat {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.phase5-edit-options .btn-quote-to-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.phase5-edit-options .btn-cancel-edit-mode {
    background: #f3f4f6;
    color: #6b7280;
    flex: 0.5;
    min-width: 80px;
}

.phase5-edit-options .btn-cancel-edit-mode:hover {
    background: #e5e7eb;
}

/* Orchestrator 回复样式 */
.orchestrator-reply {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 10px;
    border-left: 4px solid #6366f1;
}

.orchestrator-reply i {
    color: #6366f1;
    font-size: 18px;
    margin-top: 2px;
}

.orchestrator-reply span {
    color: #374151;
    line-height: 1.6;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .phase-result-card {
        background: #1f2937;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .phase-title {
        color: #f3f4f6;
    }
    
    .phase-reasoning p,
    .region-item,
    .subagent-item {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .region-id,
    .subagent-id {
        color: #f3f4f6;
    }
    
    .region-reason,
    .subagent-findings {
        color: #9ca3af;
    }
    
    .report-content {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(245, 158, 11, 0.3);
        color: #d1d5db;
    }
}

/* ==================== 用户添加区域标签样式 ==================== */

.region-item.user-added {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
}

.region-info.user-add-tag {
    color: #d97706;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    .region-item.user-added {
        background: rgba(245, 158, 11, 0.15);
    }
    
    .region-info.user-add-tag {
        color: #fbbf24;
        background: rgba(245, 158, 11, 0.2);
    }
}

/* ==================== 修改理由对话框样式 ==================== */

.modification-reason-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modification-reason-dialog .dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modification-reason-dialog .dialog-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: dialogFadeIn 0.2s ease;
}

@keyframes dialogFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modification-reason-dialog .dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modification-reason-dialog .dialog-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.modification-reason-dialog .dialog-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.modification-reason-dialog .dialog-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modification-reason-dialog .dialog-body {
    padding: 20px;
}

.modification-reason-dialog .changes-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    color: #0369a1;
    font-size: 14px;
}

.modification-reason-dialog .reason-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.modification-reason-dialog .reason-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modification-reason-dialog .dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.modification-reason-dialog .btn-cancel {
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modification-reason-dialog .btn-cancel:hover {
    background: #f3f4f6;
}

.modification-reason-dialog .btn-confirm {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.modification-reason-dialog .btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* ==================== AI 评估结果样式 ==================== */

.ai-review-message {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.ai-review-message.approved {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ai-review-message.disapproved {
    background: #fef2f2;
    border-color: #fecaca;
}

.ai-review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-review-header .status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ai-review-message.approved .status-icon {
    background: #22c55e;
    color: white;
}

.ai-review-message.disapproved .status-icon {
    background: #ef4444;
    color: white;
}

.ai-review-header .status-text {
    font-weight: 600;
    font-size: 15px;
}

.ai-review-message.approved .status-text {
    color: #166534;
}

.ai-review-message.disapproved .status-text {
    color: #991b1b;
}

.ai-review-reason {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.ai-review-suggestion {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px;
    color: #9a3412;
    font-size: 14px;
    margin-bottom: 12px;
}

.ai-review-suggestion strong {
    display: block;
    margin-bottom: 4px;
}

.ai-review-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.ai-review-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-review-actions .btn-accept-suggestion {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    color: #166534;
}

.ai-review-actions .btn-accept-suggestion:hover {
    background: #dcfce7;
}

.ai-review-actions .btn-insist {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
}

.ai-review-actions .btn-insist:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* ⭐ 智能人机协作 - "忽略提示，继续"按钮 */
.ai-review-actions .btn-dismiss-continue {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.ai-review-actions .btn-dismiss-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* AI 提示说明 */
.ai-review-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
    font-size: 13px;
    color: #0369a1;
}

.ai-review-notice i {
    color: #0ea5e9;
    font-size: 14px;
}

/* 已忽略状态 */
.ai-review-message.dismissed {
    opacity: 0.7;
    border-style: dashed;
}

.ai-review-message.dismissed .ai-review-header .status-text::after {
    content: ' (已忽略)';
    font-weight: normal;
    font-size: 12px;
    color: #64748b;
}

/* ==================== 暗色模式 - 对话框 ==================== */

@media (prefers-color-scheme: dark) {
    .modification-reason-dialog .dialog-content {
        background: #1f2937;
    }
    
    .modification-reason-dialog .dialog-header {
        border-color: #374151;
    }
    
    .modification-reason-dialog .dialog-header h3 {
        color: #f3f4f6;
    }
    
    .modification-reason-dialog .dialog-close {
        color: #9ca3af;
    }
    
    .modification-reason-dialog .dialog-close:hover {
        background: #374151;
        color: #f3f4f6;
    }
    
    .modification-reason-dialog .changes-summary {
        background: rgba(14, 165, 233, 0.1);
        border-color: rgba(14, 165, 233, 0.3);
        color: #7dd3fc;
    }
    
    .modification-reason-dialog .reason-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .modification-reason-dialog .reason-input:focus {
        border-color: #8b5cf6;
    }
    
    .modification-reason-dialog .dialog-footer {
        border-color: #374151;
    }
    
    .modification-reason-dialog .btn-cancel {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .modification-reason-dialog .btn-cancel:hover {
        background: #4b5563;
    }
    
    .ai-review-message {
        background: #1f2937;
        border-color: #374151;
    }
    
    .ai-review-message.approved {
        background: rgba(34, 197, 94, 0.1);
        border-color: rgba(34, 197, 94, 0.3);
    }
    
    .ai-review-message.disapproved {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }
    
    .ai-review-message.approved .status-text {
        color: #86efac;
    }
    
    .ai-review-message.disapproved .status-text {
        color: #fca5a5;
    }
    
    .ai-review-reason {
        color: #d1d5db;
    }
    
    .ai-review-suggestion {
        background: rgba(245, 158, 11, 0.1);
        border-color: rgba(245, 158, 11, 0.3);
        color: #fcd34d;
    }
    
    .ai-review-actions .btn-accept-suggestion {
        background: rgba(34, 197, 94, 0.1);
        border-color: #22c55e;
        color: #86efac;
    }
    
    .ai-review-actions .btn-accept-suggestion:hover {
        background: rgba(34, 197, 94, 0.2);
    }
}

/* ==================== 协作模式：分析结果编辑功能 ==================== */

/* 编辑按钮 - 位于标题栏右侧 */
.btn-edit-analysis {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.route-tree-header:hover .btn-edit-analysis {
    opacity: 1;
}

.btn-edit-analysis:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.5);
}

/* 引用到聊天按钮 - 让 AI 重新解读 */
.btn-quote-analysis {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.route-tree-header:hover .btn-quote-analysis {
    opacity: 1;
}

.btn-quote-analysis:hover {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.5);
}

/* 已编辑标识 */
.edited-badge {
    font-size: 11px;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.edited-badge i {
    font-size: 10px;
}

/* 已编辑的树节点 */
.collab-tree-node.user-edited {
    border-left: 3px solid #f59e0b;
}

.collab-tree-node.user-edited .route-tree-content {
    background: rgba(245, 158, 11, 0.05);
}

/* 编辑容器 */
.analysis-edit-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 编辑 textarea */
.analysis-edit-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #6366f1;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    background: #1e1e2e;
    color: #e5e7eb;
}

.analysis-edit-textarea:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* 编辑操作按钮 */
.analysis-edit-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.analysis-edit-actions button {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-save-analysis {
    background: #22c55e;
    color: white;
    border: none;
}

.btn-save-analysis:hover {
    background: #16a34a;
}

.btn-cancel-analysis {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #4b5563;
}

.btn-cancel-analysis:hover {
    background: rgba(107, 114, 128, 0.2);
    color: #d1d5db;
}

.btn-restore-analysis {
    background: transparent;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.btn-restore-analysis:hover {
    background: rgba(245, 158, 11, 0.15);
}

/* 原始分析提示 */
.analysis-original-hint {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
}

.analysis-original-hint i {
    color: #60a5fa;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .analysis-edit-textarea {
        background: #1e1e2e;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    .analysis-edit-textarea:focus {
        border-color: #818cf8;
    }
}

/* 浅色模式 */
@media (prefers-color-scheme: light) {
    .analysis-edit-textarea {
        background: #ffffff;
        color: #1f2937;
        border-color: #d1d5db;
    }
    
    .analysis-edit-textarea:focus {
        border-color: #6366f1;
    }
    
    .btn-cancel-analysis {
        color: #6b7280;
        border-color: #d1d5db;
    }
    
    .analysis-original-hint {
        color: #9ca3af;
    }
}

/* ==================== End 分析结果编辑功能 ==================== */

/* ==================== 引用分析结果功能 (Quote to AI) ==================== */

/* 引用卡片样式 - 显示在聊天输入框上方 */
.analysis-quote-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    position: relative;
    animation: quoteCardAppear 0.3s ease-out;
}

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

.analysis-quote-card .quote-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.analysis-quote-card .quote-icon {
    color: #818cf8;
    font-size: 12px;
}

.analysis-quote-card .quote-title {
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

.analysis-quote-card .quote-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.analysis-quote-card .quote-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.analysis-quote-card .quote-content {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #818cf8;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    color: #d1d5db;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
}

.analysis-quote-card .quote-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analysis-quote-card .quote-hint i {
    color: #f59e0b;
}

/* 左侧面板引用高亮状态 */
.collab-tree-node.quote-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.collab-tree-node.quote-active .route-tree-header {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3) 0%, transparent 100%);
}

/* 聊天消息 - 带引用的用户消息 */
.chat-message.user.quoted-message {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.chat-message.user.quoted-message .quoted-reference {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #818cf8;
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
}

.chat-message.user.quoted-message .quoted-ref-header {
    font-size: 11px;
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-message.user.quoted-message .quoted-ref-content {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.chat-message.user.quoted-message .message-text {
    color: #e5e7eb;
    font-size: 14px;
}

.chat-message.user.quoted-message .message-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

/* 聊天消息 - AI 重新解读结果 */
.chat-message.assistant.reanalysis-result {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.chat-message.assistant.reanalysis-result .reanalysis-header {
    font-size: 12px;
    color: #4ade80;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-message.assistant.reanalysis-result .reanalysis-header i {
    animation: spin 2s linear infinite;
}

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

.chat-message.assistant.reanalysis-result .message-text {
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.chat-message.assistant.reanalysis-result .reanalysis-note {
    font-size: 11px;
    color: #6ee7b7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-message.assistant.reanalysis-result .message-avatar {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

/* AI已更新标识 */
.edited-badge.ai-updated {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(16, 185, 129, 0.15) 100%);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.edited-badge.ai-updated i {
    font-size: 10px;
}

/* 左侧面板更新动画 */
.collab-tree-node.just-updated {
    animation: justUpdated 2s ease-out;
}

@keyframes justUpdated {
    0% {
        background: rgba(34, 197, 94, 0.3);
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    }
    100% {
        background: inherit;
        box-shadow: none;
    }
}

/* 浅色模式适配 */
@media (prefers-color-scheme: light) {
    .analysis-quote-card {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
        border-color: rgba(99, 102, 241, 0.25);
    }
    
    .analysis-quote-card .quote-content {
        background: rgba(99, 102, 241, 0.08);
        color: #4b5563;
    }
    
    .chat-message.user.quoted-message {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    }
    
    .chat-message.user.quoted-message .quoted-reference {
        background: rgba(99, 102, 241, 0.08);
    }
    
    .chat-message.user.quoted-message .quoted-ref-content {
        color: #6b7280;
    }
    
    .chat-message.user.quoted-message .message-text {
        color: #1f2937;
    }
    
    .chat-message.assistant.reanalysis-result {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%);
    }
    
    .chat-message.assistant.reanalysis-result .message-text {
        background: rgba(34, 197, 94, 0.08);
        color: #1f2937;
    }
}

/* ==================== End 引用分析结果功能 ==================== */

/* ==================== End 五阶段协作模式样式 ==================== */
