/* --- 对话画布 (Dialogue Canvas) v2.0 重制版 --- */

/* 1. 模态框容器：深邃宇宙背景 */
.canvas-modal {
    display: none;   /* 调试时暂时注释 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    /* 核心背景：深蓝渐变 */
    background: linear-gradient(to bottom, #02060a 0%, #0d1620 100%);
    font-family: 'Noto Serif SC', 'Cinzel', serif;
    overflow: hidden; /* 防止背景滚动溢出 */
}

/* 2. 第一层星空：背景细碎星尘 (慢速漂移) */
.canvas-modal::before {
    content: "";
    position: absolute;
    top: 0; left: 0; 
    width: 200%; height: 200%; /* 放大容器以便移动 */
    
    /* 生成细小的白色星点，锐利不模糊 */
    background-image: 
        radial-gradient(1px 1px at 10% 10%, #fff, transparent),
        radial-gradient(1px 1px at 20% 30%, #fff, transparent),
        radial-gradient(1px 1px at 30% 15%, #fff, transparent),
        radial-gradient(1px 1px at 40% 60%, #fff, transparent),
        radial-gradient(1px 1px at 50% 30%, #fff, transparent),
        radial-gradient(1px 1px at 60% 80%, #fff, transparent),
        radial-gradient(1px 1px at 70% 50%, #fff, transparent),
        radial-gradient(1px 1px at 80% 20%, #fff, transparent),
        radial-gradient(1px 1px at 90% 70%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 25% 85%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 75% 15%, rgba(255,255,255,0.8), transparent);
    
    background-size: 500px 500px; /* 定义星图重复的单元大小 */
    background-repeat: repeat;
    opacity: 0.5;
    
    /* 动画：左上角斜向缓慢移动 */
    animation: star-drift 120s linear infinite;
    z-index: -2;
}

/* 3. 第二层星空：近处亮星 (较快漂移 + 呼吸闪烁) */
.canvas-modal::after {
    content: "";
    position: absolute;
    top: -50%; left: -50%; 
    width: 200%; height: 200%;
    
    /* 较大的亮星，更稀疏 */
    background-image: 
        radial-gradient(2px 2px at 15% 15%, #fff, transparent),
        radial-gradient(2px 2px at 45% 75%, #fff, transparent),
        radial-gradient(2px 2px at 85% 35%, #fff, transparent),
        radial-gradient(2.5px 2.5px at 50% 50%, #fff, transparent); /* 一颗特亮的主星 */
        
    background-size: 600px 600px; /* 错开背景尺寸，增加随机感 */
    background-repeat: repeat;
    
    /* 复合动画：位移 + 闪烁 */
    animation: 
        star-drift 80s linear infinite reverse, /*反向移动，制造视差立体感*/
        star-twinkle 4s ease-in-out infinite alternate; /* 呼吸闪烁 */
        
    z-index: -1;
}

/* --- 动画定义 --- */

/* 星星漂移：移动 background-position 或者 translate */
@keyframes star-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(-100px, -200px); }
}

/* 星星闪烁：改变透明度 */
@keyframes star-twinkle {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}


/* 2. 核心视口 */
.canvas-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-bottom: 150px; /* 底部留白 */
    perspective: 1000px; /* 增加3D透视感 */
}

/* 3. 连线层：金色星轨 */
.thought-trails {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    filter: drop-shadow(0 0 5px rgba(197, 160, 89, 0.5)); /* 发光效果 */
}

.trail-path {
    fill: none;
    stroke: #c5a059; /* 金色 */
    stroke-width: 1.5px;
    opacity: 0.6;
    /* 不再是虚线，而是像星图连线一样的实线 */
}

/* 4. 节点流容器 */
.thought-stream {
    position: relative;
    max-width: 1100px; /* 更宽一点 */
    margin: 0 auto;
    padding: 100px 40px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

/* 5. 通用节点卡片样式 */
.thought-node {
    position: relative;
    max-width: 48%;
    padding: 0; /* 内部布局负责padding */
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: floatIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(30px) rotateX(5deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* 悬停效果：轻微上浮 + 发光增强 */
.thought-node:hover {
    transform: translateY(-5px);
    z-index: 10;
}

/* --- 用户提问卡片：极简便签风格 --- */
.thought-node.question-node {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1); /* 半透明玻璃感 */
    border-left: 4px solid #fff;
    backdrop-filter: blur(10px);
    padding: 20px 25px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 0 10px 10px 0;
}

.question-node .user-avatar-mark {
    position: absolute;
    left: -20px;
    top: -15px;
    width: 40px;
    height: 40px;
    background: #fff;
    color: #0d1218;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-handwriting {
    font-family: 'Ma Shan Zheng', cursive; /* 手写体 */
    font-size: 1.4rem;
    line-height: 1.6;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- 北极星回答卡片：古典羊皮纸风格 (修复版) --- */
.thought-node.answer-node {
    align-self: flex-end;
    background: #f4ecd8; 
    color: #2c1e12;
    
    /* 1. [核心修复] 移除原来的 clip-path (这个是造成切角生硬的元凶) */
    clip-path: none !important; 
    
    /* 2. 使用圆角：左上、右上、左下为小圆角，右下角为大圆角(模拟卷起) */
    border-radius: 4px 4px 4px 50px; 
    
    /* 3. 优化阴影：增加层次感 */
    box-shadow: 
        0 2px 5px rgba(0,0,0,0.05),       /* 基础阴影 */
        0 15px 30px rgba(0,0,0,0.2),      /* 远距离投影 */
        inset 0 0 60px rgba(139, 90, 43, 0.1); /* 纸张旧感内发光 */
        
    border: 1px solid rgba(139, 90, 43, 0.2);
    padding: 30px 40px;
    position: relative; /* 为伪元素定位做准备 */
}

/* 4. [核心修复] 新增：使用伪元素模拟右下角的“卷起阴影”，增加立体感 */
.thought-node.answer-node::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    z-index: -1; /* 放在纸张下面 */
    
    /* 这是一个柔和的投影，模拟纸角翘起 */
    box-shadow: 8px 8px 15px rgba(0, 0, 0, 0.4); 
    
    /* 配合父元素的大圆角，形成翘起感 */
    transform: skew(15deg) rotate(5deg);
    border-radius: 50%;
}

/* 5. [核心修复] 新增：模拟纸张卷起背面的高光（可选，增加精致度） */
.thought-node.answer-node::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 50px;
    
    /* 线性渐变模拟纸张卷曲的折痕光影 */
    background: linear-gradient(135deg, transparent 45%, rgba(0,0,0,0.05) 50%, rgba(255,255,255,0.3) 100%);
    border-radius: 0 0 4px 50px;
    pointer-events: none;
}

/* 保持原来的悬停高亮 */
.thought-node.answer-node:hover {
    box-shadow: 
        0 20px 50px rgba(197, 160, 89, 0.15),
        inset 0 0 20px rgba(139, 90, 43, 0.1);
    transform: translateY(-2px); /* 悬停轻微上浮 */
}

/* 北极星卡片内部元素 */
.star-decoration-top {
    text-align: center;
    color: #8b5a2b;
    margin-bottom: 15px;
    font-size: 1.2rem;
    opacity: 0.7;
}

.leader-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.leader-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #3e2723;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.leader-badges {
    margin-top: 5px;
}

.badge-field {
    font-size: 0.75rem;
    font-weight: bold;
    background: transparent;
    color: #000000;
    padding: 2px 8px;
    border: 1px solid #D4AF37; 
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leader-contribution-hint {
    font-size: 0.9rem;
    color: #6d4c41;
    font-style: italic;
    text-align: center;
    opacity: 0.8;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.node-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #8b5a2b, transparent);
    margin: 15px 0 20px 0;
    opacity: 0.4;
}

.star-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1a1a1a;
    text-align: justify;
}

.star-decoration-bottom {
    margin-top: 25px;
    text-align: right;
    font-size: 0.8rem;
    color: #8b5a2b;
    font-family: 'Cinzel', serif;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* 6. 右侧侧边栏 (保持不变或微调颜色) */
.inspiration-sidebar {
    background: #fdfbf7;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
}

/* 7. 顶部工具栏适配深色背景 */
/* ==========================================
   [优化] 对话画布工具栏- 响应式双层布局
   ========================================== */
/* --- 顶部导航条：标题与关闭按钮同行 --- */
/* --- 第一行：极窄导航条 (约35px) --- */
/* --- 统一工具栏基础：取消模糊，增加实色感 --- */
/* --- 基础设置：实色背景，彻底移除模糊 --- */
.canvas-nav-bar, .canvas-action-bar {
    position: fixed;
    left: 0;
    width: 100%;
    background: #02060a; /* 纯黑背景，确保节点滑过时边缘清晰 */
    border-bottom: 1px solid rgba(197, 160, 89, 0.15);
    z-index: 2100;
    box-sizing: border-box;
    backdrop-filter: none !important; /* 移除模糊 */
    -webkit-backdrop-filter: none !important;
}

/* --- 第一行样式 --- */
.canvas-nav-bar {
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.canvas-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #c5a059;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}

.canvas-close-btn {
    margin-left: auto;
    background: transparent !important;
    border: none;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.canvas-close-btn:hover { color: #fff; }

/* --- 第二行样式 --- */
.canvas-action-bar {
    display: flex;
    justify-content: flex-start; /* 按钮靠左 */
    align-items: center;
    padding: 0 12px;
}

.action-group {
    display: flex;
    align-items: center;
}

.canvas-action-bar button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(197, 160, 89, 0.2);
    color: #c5a059;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.canvas-action-bar button:hover {
    background: #c5a059;
    color: #02060a;
}

/* ============================================================
   电脑端优化 (屏幕宽度 > 1024px)
   ============================================================ */
@media (min-width: 1024px) {
    .canvas-nav-bar { height: 42px; }     /* 适度放宽高度以容纳大字体 */
    .canvas-action-bar { height: 42px; top: 42px; }

    .canvas-title { font-size: 1.25rem; } /* 电脑端标题放大 */
    .canvas-close-btn { font-size: 1.6rem; }

    .action-group { gap: 10px; }
    .canvas-action-bar button {
        width: 34px;  /* 按钮变大 */
        height: 34px;
        font-size: 1rem; /* 内部图标变大 */
    }

    .divider-v {
        width: 1px;
        height: 18px;
        background: rgba(197, 160, 89, 0.2);
        margin: 0 8px;
    }

    /* 内容区顶部间距相应增加，总高 84px + 预留 36px */
    .thought-stream { padding: 120px 40px 60px 40px !important; }
}

/* ============================================================
   手机端保持 (屏幕宽度 <= 768px)
   ============================================================ */
@media (max-width: 768px) {
    .canvas-nav-bar { height: 32px; }
    .canvas-action-bar { height: 32px; top: 32px; }

    .canvas-title { font-size: 0.9rem; } /* 手机端维持小字号 */
    .canvas-close-btn { font-size: 1.1rem; }

    .action-group { gap: 6px; }
    .canvas-action-bar button {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .divider-v {
        width: 1px;
        height: 12px;
        background: rgba(197, 160, 89, 0.2);
        margin: 0 4px;
    }

    /* 内容区顶部间距，总高 64px + 预留 16px */
    .thought-stream { padding: 80px 15px 40px 15px !important; }
}

/* 删除按钮样式 */
.node-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 0, 0, 0.1);
    color: #ff4d4f;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* 默认隐藏 */
    transition: all 0.3s ease;
    z-index: 10;
}

.node-delete-btn:hover {
    background: #ff4d4f;
    color: white;
}

/* 鼠标悬停在节点上时显示删除按钮 */
.thought-node:hover .node-delete-btn {
    opacity: 1;
}

/* 确保节点定位基准 */
.thought-node {
    position: relative; /* 确保绝对定位相对于节点 */
}

/* --- 灵感手稿侧边栏 (Inspiration Sidebar) --- */
#inspirationSidebar {
    /* 1. 核心定位：必须 Fixed 才能悬浮在视口上 */
    position: fixed;
    top: 0;
    right: -350px; /* 默认隐藏在屏幕外 (宽度350px) */
    width: 350px;
    height: 100vh;
    
    /* 2. 关键层级：必须大于 canvas-modal 的 2000 */
    z-index: 3000 !important; 
    
    /* 3. 视觉样式 */
    background: #fdfbf7; /* 羊皮纸色 */
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    
    /* 4. 动画过渡 */
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 当 JS 添加 .open 类时，滑入屏幕 */
#inspirationSidebar.open {
    right: 0;
}

/* 头部样式 */
.sidebar-header {
    padding: 20px;
    background: #f4ecd8;
    border-bottom: 2px solid #e0dcd0;
    flex-shrink: 0; /* 防止头部被压缩 */
}

.sidebar-header h3 {
    margin: 0;
    color: #8b5a2b;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header p {
    margin: 5px 0 0 0;
    font-size: 0.8rem;
    color: #888;
}

/* 笔记容器样式 */
.notes-container {
    flex: 1; /* 占满剩余高度 */
    overflow-y: auto; /* 允许滚动 */
    padding: 20px;
    outline: none; /* 去除 contenteditable 的蓝色边框 */
    font-family: 'Noto Serif SC', serif;
    color: #4a3b32;
    line-height: 1.6;
}

/* Placeholder 占位符逻辑 (纯CSS实现) */
.notes-container[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    font-style: italic;
    pointer-events: none;
}

/* JS 动态添加进来的笔记块样式 */
.inspiration-note-block {
    background: #fff;
    border-left: 3px solid #8b5a2b;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 0.95rem;
    position: relative;
    /* 防止被误删，设为不可编辑，或者设为 true 允许修改 */
    user-select: text; 
}

/* 给笔记块加个引号装饰 */
.inspiration-note-block::before {
    content: '"';
    font-family: serif;
    font-size: 2rem;
    color: rgba(139, 90, 43, 0.2);
    position: absolute;
    top: -5px;
    left: 5px;
    pointer-events: none;
}

/* ==========================================
   对话北极星 PDF导出：商业级白皮书样式
   ========================================== */

/* ==========================================
   对话北极星 PDF导出：典雅商业白皮书样式 (修正排版与背景版)
   ========================================== */

/* --- 1. 打印替身的基础设置 --- */
#print-overlay {
    position: fixed; top: -9999px; left: -9999px; width: 100vw; z-index: -1;
}

/* --- 2. 页面设置：A4 标准留白 --- */
@page {
    /* 上下留 15mm，左右留 12mm */
    margin: 15mm 12mm; 
    size: A4 auto; 
}

/* --- 3. 打印媒体查询 --- */
@media print {
    body > *:not(#print-overlay) { display: none !important; }

    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
  
    #print-overlay {
        position: absolute !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important; max-width: 100% !important; 
        z-index: 99999 !important;
        background: #ffffff !important;
        
        color: #222222 !important;
        font-family: 'Noto Serif SC', 'SimSun', 'Times New Roman', serif !important;
        font-size: 11pt !important; 
        /* 【修改点】：整体行高从 1.75 微微收紧到 1.6，更适合大量文本阅读 */
        line-height: 1.6 !important; 
    }

    /* 角色标题样式 */
    #print-overlay .print-role-title {
        font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif !important;
        font-size: 10.5pt !important;
        font-weight: 700 !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.5px !important;
    }
    #print-overlay .user-role { color: #1a2a3a !important; }
    #print-overlay .ai-role { color: #b8860b !important; } /* 北极星暗金色 */

   /* --- 对话气泡全局容器 --- */
    #print-overlay .thought-node {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        page-break-inside: avoid !important;
        margin-bottom: 20px !important;
        padding: 20px 25px !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        white-space: normal !important;      /* 关键：折叠空白 */
        box-sizing: border-box !important;
        text-align: left !important;
    }


    /* ==========================================
       User 提问区块 
       ========================================== */
    #print-overlay .question-node {
        /* 【修改点】：恢复北极星专属的极浅莫兰迪灰蓝色，告别冷灰白 */
        background-color: #f7f9fa !important; 
        border-left: 4px solid #34495e !important; 
        border-top: 1px solid #eef1f5 !important;
        border-right: 1px solid #eef1f5 !important;
        border-bottom: 1px solid #eef1f5 !important;
    }
    
    #print-overlay .question-node,
    #print-overlay .question-node *,
    #print-overlay .question-node p {
        color: #1a252f !important; 
        -webkit-text-fill-color: #1a252f !important; 
        text-shadow: none !important; 
        -webkit-text-stroke: 0 !important; 
        background-image: none !important; 
        background-clip: border-box !important; 
        -webkit-background-clip: border-box !important;
        font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif !important; 
        font-weight: 600 !important; 
        font-size: 11pt !important;
        letter-spacing: normal !important;
    }

    /* ==========================================
       专家回答区块 (恢复古典暖色调)
       ========================================== */
    #print-overlay .answer-node {
        /* 【修改点】：恢复古色古香的极淡香槟米黄底色 */
        background-color: #fffcf8 !important; 
        border: 1px solid #f2e9d3 !important; 
        border-top: 3px solid #D4AF37 !important; 
    }

    /* --- 排版细节：段落与列表 (核心修复间距) --- */
    #print-overlay .thought-node * {
        margin-top: 0 !important;
        box-shadow: none !important; 
    }

    #print-overlay .thought-node p {
        margin-bottom: 20px !important;       /* 从 6px 增加到 10px */
        text-align: justify !important;
        line-height: 1.6 !important;
    }
    
    #print-overlay .thought-node p:last-child { margin-bottom: 0 !important; }
    #print-overlay .thought-node p:empty { display: none !important; }
    
    #print-overlay .thought-node ul, 
    #print-overlay .thought-node ol {
        margin-top: 8px !important;
        margin-bottom: 20px !important;       /* 与段落统一 */
        padding-left: 20px !important;
    }
    
    #print-overlay .thought-node li {
        margin-bottom: 12px !important;        /* 列表项间稍微紧一点，仍可读 */
        line-height: 1.6 !important;
    }
    
    /* 【核弹级修改】：强制剥夺列表中 <p> 标签的边距！
       防止 Markdown 渲染出 <li><p>文本</p></li> 导致的边距双重叠加 */
    #print-overlay .thought-node li p {
        margin-bottom: 0 !important;
        display: inline !important; 
    }
    
    /* --- 标题间距：分级呼吸感 --- */
    #print-overlay .thought-node h1,
    #print-overlay .thought-node h2,
    #print-overlay .thought-node h3 {
        font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif !important;
        color: #111111 !important;
        border-bottom: 1px solid #eeeeee !important;
        padding-bottom: 8px !important;
    }
    
    /* 大标题：章节间隔明显，与下方内容保持适度距离 */
    #print-overlay .thought-node h1,
    #print-overlay .thought-node h2 {
        margin-top: 48px !important;          /* 章节前呼吸感 */
        margin-bottom: 24px !important;
    }
    /* 大标题如果是节点内第一个元素，去掉顶部空白 */
    #print-overlay .thought-node h1:first-child,
    #print-overlay .thought-node h2:first-child {
        margin-top: 0 !important;
    }
    
    /* 小标题：与上文（段落或列表）保持自然间隔，与下文紧密 */
    #print-overlay .thought-node h3 {
        margin-top: 8px !important;           /* 加上前文的 10px 底部 ≈ 14px */
        margin-bottom: 24px !important;
    }
    /* 小标题紧跟大标题时，上边距合并后约为 12px，不会过大 */
    
    #print-overlay .thought-node strong, #print-overlay .thought-node b {
        font-weight: 800 !important;
        color: #000000 !important;
    }

    /* --- 隐藏无关元素 --- */
    #print-overlay .node-delete-btn, #print-overlay .action-bar, #print-overlay button {
        display: none !important;
    }
  
    /* --- 标志与领域标签修正 --- */
    #print-overlay .badge-field {
        background: transparent !important;
        color: #b8860b !important; /* 北极星金 */
        font-weight: 700 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif !important;
        border: 1px solid #ebdcb5 !important;
        padding: 3px 8px !important; 
        border-radius: 4px !important;
        font-size: 9pt !important;
    }

    /* 底部北极星 Insight 装饰块：拉开与正文的距离 */
    #print-overlay .star-decoration-bottom {
        margin-top: 40px !important;   /* 原为 25px，增大到 40px */
    }
    
    #print-overlay .node-divider {
        height: 1px !important;
        background: linear-gradient(to right, transparent, #D4AF37, transparent) !important;
        opacity: 0.4 !important;
        margin: 15px 0 !important; 
        border: none !important;
    }
}

/* 适配移动端 */
@media (max-width: 768px) {
    .thought-stream {
        /* 大幅减少两侧留白，释放屏幕宽度 */
        padding: 40px 12px;
        gap: 40px;
        max-width: 100%;
    }
    
    .thought-node {
        /* 宽度从48%改为92%，充分利用屏幕 */
        max-width: 92%;
        width: 92%;
    }
    
    /* 用户提问卡片：减少padding，字体缩小 */
    .thought-node.question-node {
        padding: 15px 18px;
        border-radius: 8px;
        align-self: center;
        margin-right: auto;
    }
    
    .user-handwriting {
        font-size: 1.15rem;  /* 从1.4rem缩小 */
        line-height: 1.6;    /* 从1.6收紧 */
        letter-spacing: 0.5px;
    }
    
    /* 北极星回答卡片：大幅减少padding，优化字体 */
    .thought-node.answer-node {
        padding: 20px 18px;        /* 从30px 40px缩减 */
        border-radius: 4px 4px 4px 30px; /* 右下角卷起效果缩小 */
        align-self: center;
        margin-left: auto;
    }
    
    /* 卡片内部元素字号统一缩小 */
    .leader-name {
        font-size: 1.2rem;      /* 从1.5rem缩小 */
        letter-spacing: 1px;
    }
    
    .badge-field {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .leader-contribution-hint {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .star-content {
        font-size: 0.95rem;     /* 从1.05rem缩小 */
        line-height: 1.65;      /* 从1.8收紧，每行显示更多字 */
        text-align: left;       /* 手机端左对齐更易读 */
    }
    
    .node-divider {
        margin: 10px 0 15px 0;
    }
    
    .star-decoration-bottom {
        margin-top: 15px;
        font-size: 0.75rem;
    }
    
    /* 删除按钮在移动端始终可见（方便操作） */
    .node-delete-btn {
        opacity: 0.6;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    /* 顶部工具栏适配 */
    .canvas-toolbar {
        padding: 10px 15px;
    }
    
    .canvas-title {
        font-size: 1.1rem;
    }
    
    /* 连线层：在手机端减弱效果，避免视觉干扰 */
    .trail-path {
        stroke-width: 1px;
        opacity: 0.4;
    }
}

/* 超小屏幕额外优化 */
@media (max-width: 480px) {
    .thought-stream {
        padding: 30px 8px;   /* 进一步减少留白 */
        gap: 30px;
    }
    
    .thought-node {
        max-width: 96%;      /* 几乎撑满屏幕 */
        width: 96%;
    }
    
    .thought-node.question-node,
    .thought-node.answer-node {
        padding: 12px 14px;
    }
    
    .user-handwriting {
        font-size: 1.05rem;
    }
    
    .star-content {
        font-size: 0.9rem;
        line-height: 1.55;   /* 更紧凑的行高 */
    }
    
    .leader-name {
        font-size: 1.1rem;
    }
    
    /* 隐藏用户头像标记，节省空间 */
    .question-node .user-avatar-mark {
        display: none;
    }
}

/* ==========================================
   对话画布移动端性能优化
   ========================================== */

@media (max-width: 768px) {
    /* 禁用星空背景动画，改为静态 */
    .canvas-modal::before,
    .canvas-modal::after {
        animation: none !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        opacity: 0.3;
    }
    
    /* 禁用毛玻璃 */
    .thought-node.question-node {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    /* 禁用3D透视 */
    .canvas-viewport {
        perspective: none !important;
    }
    
    /* 禁用节点入场动画 */
    .thought-node {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .thought-node:hover {
        transform: none !important;
    }
    
    /* 简化阴影，禁用卷角伪元素 */
    .thought-node.answer-node {
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        border-radius: 4px !important;
    }
    
    .thought-node.answer-node::after,
    .thought-node.answer-node::before {
        display: none !important;
    }
    
    /* 简化连线 */
    .trail-path {
        stroke-width: 1px !important;
        opacity: 0.3 !important;
    }
    
    /* 减少重绘区域 */
    .canvas-viewport {
        contain: layout style paint;
    }
    
    .thought-stream {
        contain: layout;
    }
}

@media (max-width: 480px) {
    .canvas-modal::before,
    .canvas-modal::after {
        opacity: 0.15;
    }
}
