
/* ================= 极致纯净的全局样式 ================= */
body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background-color: #fafafa;
    color: #111827; 
    margin: 0; 
    overflow: hidden; 
    transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* 优雅的滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 输入框高级质感 */
.workspace-input { 
    width: 100%; background: #ffffff; border: 1px solid #e5e7eb; 
    color: #111827; border-radius: 8px; padding: 8px 12px; 
    font-size: 0.85rem; transition: all 0.2s ease; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.workspace-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
textarea.ghost-input { resize: none; background: transparent; border: none; outline: none; padding: 0; box-shadow: none; color: #374151; }
textarea.ghost-input:focus { outline: none; box-shadow: none; }

/* 气泡对话美化 */
.chat-msg { display: flex; gap: 16px; margin-bottom: 24px; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.avatar { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.avatar.user { background: #3b82f6; }
.avatar.ai { background: #10b981; }
.avatar.system { background: #64748b; }
.avatar.report { background: #8b5cf6; }

.bubble { background: #ffffff; border: 1px solid #f1f5f9; border-radius: 12px; padding: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02); flex: 1; max-width: 85%; }

/* 进度条 */
.progress-container { width: 100%; background: #f1f5f9; border-radius: 999px; height: 6px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; background: #6366f1; transition: width 0.3s ease; }

/* 按钮与拖拽区 */
.btn-action { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.85rem; padding: 8px 18px; border-radius: 8px; transition: all 0.2s; cursor: pointer; }
.file-upload-wrapper { border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 20px; text-align: center; background: #f8fafc; transition: all 0.2s; cursor: pointer; }
.file-upload-wrapper:hover { border-color: #6366f1; background: #eef2ff; }

/* ================= ✨ 纯净聚焦流引擎 (Focus Mode - Zen Card Solo) ================= */
#layoutWrapper {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

.panel-section {
    height: 100%;
    background: #ffffff;
    flex-shrink: 0;
}

/* Focus Mode 顶部切换器默认隐藏，仅在 Focus Mode 下启用 */
#focusSwitcher {
    display: none !important;
}

.focus-mode-active #focusSwitcher {
    display: flex !important;
}

.focus-mode-active {
    background-color: #f1f5f9 !important;
    background-image: radial-gradient(at top left, #f8fafc, #cbd5e1) !important;
}

.focus-mode-active #layoutWrapper {
    justify-content: center;
    padding: 1.5rem;
    align-items: center;
    height: 100%;
    width: 100%;
}

/* 隐去未激活聚焦的面板，专注于单卡片 Zen Solo 上下文 */
.focus-mode-active .panel-section {
    display: none !important;
}

/* 核心独占面板，在视口中央平滑高亮呈现，无任何字体缩放或畸变 */
.focus-mode-active .panel-section.panel-focused {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 960px; /* 工作台大卡片黄金比例 */
    height: 88% !important;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.03);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: zenCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 配置与策略卡片独占时宽度适当收窄，确保优秀的行长可读性 */
.focus-mode-active #panelLeft.panel-focused,
.focus-mode-active #panelRight.panel-focused {
    max-width: 600px;
}

@keyframes zenCardFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.focus-mode-active .focus-hide { display: none !important; }

/* 磁性变量 */
.var-tag { transition: all 0.2s; }
.var-tag:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }

/* ================= 沉浸式编辑器与右侧标签页 ================= */
.right-tab-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================= ⚡️ 极客级文本编辑与镜像同步核心 ================= */
.template-editor-shared {
    font-family: 'JetBrains Mono', 'PingFang SC', 'Microsoft YaHei', 'Heiti SC', monospace !important;
    font-size: 0.75rem !important;
    line-height: 1.625 !important;
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    white-space: pre-wrap !important;
    word-break: break-all !important; /* 关键：强制中英文均在字符处折行，确保换行对齐完全一致 */
    overflow-wrap: break-word !important;
    padding: 12px !important;
    margin: 0 !important;
    border: none !important;
    text-transform: none !important;
    text-rendering: optimizeSpeed !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    box-sizing: border-box !important;
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* 隐藏滚动条轨道，彻底消除因滚动条宽度不一致导致的排版错位 */
.template-editor-shared::-webkit-scrollbar {
    display: none !important; /* Safari and Chrome */
}
