/* ============================================================ 文件记录窗口 + 右侧预览侧边栏 + toast 样式 复用 style.css 变量;⋯ 按钮复用 runner.css 的 .item-menu-btn ============================================================ */ /* ---------------- 文件条目:[⋯] 左 + 文件名,无状态点 ---------------- */ .file-item { height: var(--row-h); display: flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; overflow: hidden; cursor: pointer; transition: background 0.12s ease; } .file-item:hover { background: var(--hover-wash); } /* 当前正在预览的文件保持高亮 */ .file-item.is-active { background: var(--surface-wash); } .file-item.is-entering { opacity: 0; animation: todo-in 0.34s var(--ease-out) forwards; } .file-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ---------------- 右侧预览侧边栏 ---------------- */ /* 打开时悬浮窗栈向左让位 */ .float-stack { transition: right 0.3s var(--ease-out); } body.preview-open .float-stack { right: calc(20px + 440px + 12px); } /* 详情面板同样让位 */ .detail-panel { transition: right 0.3s var(--ease-out); } body.preview-open .detail-panel { right: calc(20px + 440px + 12px + var(--window-max-w) * 0.9 + 12px); } .file-preview { position: fixed; top: 20px; right: 20px; bottom: 20px; width: 440px; max-width: calc(100vw - 80px); background: var(--surface-float); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: var(--shadow-float); display: flex; flex-direction: column; overflow: hidden; z-index: 95; /* 初始藏在屏幕右缘外;用 visibility 配合 transform 做滑入滑出 */ transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform 0.3s var(--ease-out), visibility 0s linear 0.3s; } .file-preview.is-open { transform: translateX(0); visibility: visible; transition: transform 0.3s var(--ease-out), visibility 0s; } /* 预览头部:文件名 + 目录 + 关闭 */ .preview-header { flex: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--border-subtle); } .preview-header svg { flex: none; width: 15px; height: 15px; color: var(--accent); } .preview-name { flex: none; font-size: 13px; font-weight: 600; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-primary); } .preview-path { flex: 1; min-width: 0; font-size: 11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .preview-close { flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; padding: 0; background: none; border: none; border-radius: 6px; color: var(--text-tertiary); cursor: pointer; transition: background 0.12s ease, color 0.12s ease; } .preview-close svg { width: 13px; height: 13px; color: inherit; } .preview-close:hover { background: rgba(38, 36, 31, 0.07); color: var(--text-secondary); } /* 预览内容:等宽 + 行号 */ .preview-body { flex: 1; overflow: auto; padding: 8px 0 12px; scrollbar-width: none; -ms-overflow-style: none; } .preview-body::-webkit-scrollbar { display: none; width: 0; height: 0; } .code-line { display: flex; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.75; } .code-line:hover { background: var(--hover-wash); } .line-no { flex: none; width: 44px; padding-right: 12px; text-align: right; color: var(--text-tertiary); user-select: none; } .line-text { flex: 1; padding-right: 14px; white-space: pre; color: var(--text-primary); } /* ---------------- 文件菜单(普通项,非危险色) ---------------- */ .file-menu .menu-item { color: var(--text-primary); } .file-menu .menu-item:hover { background: var(--surface-wash); } /* ---------------- demo toast 反馈 ---------------- */ .demo-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(8px); padding: 8px 14px; border-radius: 8px; background: #26241f; color: #faf9f5; font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 400; } .demo-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }