/* ===== 全局(沿用新迪 2D 查看器的视觉规范:#2b9ae8 主色、白底、细边框) ===== */ * { box-sizing: border-box; } html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; font-size: 13px; color: #333; } body.embed #topbar { display: none; } body.embed #main { top: 0; } .hidden { display: none !important; } img { -webkit-user-drag: none; user-select: none; } /* ===== 顶栏 ===== */ #topbar { position: absolute; top: 0; left: 0; right: 0; height: 50px; background: #fff; border-bottom: 1px solid #e3e6e8; display: flex; align-items: center; gap: 14px; padding: 0 14px; z-index: 50; } .logo { display: flex; align-items: center; gap: 8px; } .logo-text { font-size: 19px; font-weight: 600; color: #2b9ae8; letter-spacing: 1px; } .btn-primary { background: #2b9ae8; color: #fff; border: none; border-radius: 4px; padding: 7px 18px; font-size: 13px; cursor: pointer; } .btn-primary:hover { background: #2389cf; } .btn-secondary { background: #fff; color: #2b9ae8; border: 1px solid #2b9ae8; border-radius: 4px; padding: 6px 16px; font-size: 13px; cursor: pointer; } .btn-secondary:hover { background: #f0f7fd; } .file-name { color: #888; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .layout-label { display: flex; align-items: center; gap: 6px; color: #666; font-size: 12px; flex: none; } .layout-label select, #optUnit { border: 1px solid #ddd; border-radius: 4px; padding: 4px 6px; font-size: 12px; color: #333; background: #fff; cursor: pointer; outline: none; } .top-right { display: flex; gap: 6px; } .icon-btn { width: 32px; height: 32px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; } .icon-btn:hover { border-color: #2b9ae8; } .icon-btn img { width: 18px; height: 18px; } /* ===== 主区域 ===== */ #main { position: absolute; top: 50px; left: 0; right: 0; bottom: 0; } /* ===== 左侧图层面板 ===== */ #treePanel { position: absolute; top: 0; left: 0; bottom: 0; width: 260px; background: #fff; border-right: 1px solid #e3e6e8; z-index: 40; display: flex; flex-direction: column; } body.no-tree #treePanel { display: none; } body.no-tree #viewport { left: 0; } .tree-header { padding: 10px 12px 8px; border-bottom: 1px solid #f0f2f3; } .tree-title { font-weight: 600; font-size: 14px; } .tree-count { color: #aaa; font-size: 12px; margin-left: 6px; } .tree-search { margin-top: 8px; display: flex; align-items: center; gap: 6px; border: 1px solid #ddd; border-radius: 4px; padding: 4px 8px; } .tree-search img { width: 14px; height: 14px; opacity: .6; } .tree-search input { border: none; outline: none; flex: 1; font-size: 12px; background: transparent; } .tree-actions { margin-top: 8px; display: flex; gap: 12px; } .link-btn { border: none; background: none; color: #2b9ae8; font-size: 12px; cursor: pointer; padding: 0; } .link-btn:hover { text-decoration: underline; } .tree-body { flex: 1; overflow: auto; padding: 4px 0 20px; } .tree-empty { color: #aaa; text-align: center; padding: 40px 10px; font-size: 12px; } .tree-row { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; cursor: pointer; white-space: nowrap; user-select: none; } .tree-row:hover { background: #f0f7fd; } .tree-row.off .tree-label { color: #bbb; } .tree-check { width: 14px; height: 14px; flex: none; } .layer-swatch { width: 12px; height: 12px; border: 1px solid #ccc; border-radius: 2px; flex: none; } .tree-label { overflow: hidden; text-overflow: ellipsis; font-size: 12px; flex: 1; } .tree-num { color: #bbb; font-size: 11px; flex: none; } .tree-row.matched .tree-label { color: #2b9ae8; font-weight: 600; } /* ===== 视口 ===== */ #viewport { position: absolute; top: 0; left: 260px; right: 0; bottom: 0; overflow: hidden; } #canvasWrap { position: absolute; inset: 0; cursor: default; } #canvasWrap.panning { cursor: grabbing; } #canvasWrap.crosshair { cursor: crosshair; } /* ===== 底部工具栏 ===== */ #toolbar { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; flex-direction: row; gap: 2px; z-index: 45; background: #fff; border: 1px solid #e3e6e8; border-radius: 6px; padding: 4px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); max-width: 96vw; overflow-x: auto; } .tool-btn { width: 76px; height: 80px; border: none; background: transparent; border-radius: 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #666; padding: 0; flex: none; } .tool-btn img { width: 46px; height: 46px; } .tool-btn span { font-size: 13px; line-height: 1; } .tool-btn:hover { background: #f0f7fd; color: #2b9ae8; } .tool-btn.active { background: #2b9ae8; color: #fff; } .tool-btn.active img { filter: brightness(0) invert(1); } .tool-sep { width: 1px; background: #eee; margin: 8px 4px; flex: none; } /* ===== 浮动面板 ===== */ .float-panel { position: absolute; z-index: 46; background: #fff; border: 1px solid #e3e6e8; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.12); padding: 10px 12px; width: 250px; } .panel-title { font-weight: 600; font-size: 13px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; } .panel-close { width: 14px; height: 14px; cursor: pointer; opacity: .6; } .panel-close:hover { opacity: 1; } .panel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .panel-row:last-child { margin-bottom: 0; } .panel-row > span { font-size: 12px; color: #666; flex: none; } .panel-row input[type="range"] { flex: 1; accent-color: #2b9ae8; } .panel-row input[type="text"], .panel-row textarea { flex: 1; border: 1px solid #ddd; border-radius: 4px; padding: 5px 8px; font-size: 12px; color: #444; min-width: 120px; outline: none; } .panel-row input[type="text"]:focus { border-color: #2b9ae8; } .panel-row textarea { resize: vertical; font-family: Consolas, monospace; font-size: 11px; } .panel-val { width: 44px; text-align: right; color: #2b9ae8; font-weight: 600; } /* 设置面板里的子菜单按钮(新迪同款:大图标 + 下方文字) */ .sub-tools { display: flex; gap: 6px; flex: 1; } .sub-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 58px; height: 62px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; cursor: pointer; color: #666; flex: none; } .sub-tool img { width: 34px; height: 34px; } .sub-tool span { font-size: 12px; line-height: 1; } .sub-tool:hover { background: #f0f7fd; color: #2b9ae8; } .sub-tool:active { background: #dceefb; } /* 背景色选择(与新迪 2D 一致的三色) */ .bg-swatches { display: flex; gap: 8px; flex: 1; } .bg-swatch { width: 30px; height: 24px; border: 2px solid #ddd; border-radius: 4px; cursor: pointer; padding: 0; position: relative; } .bg-swatch:hover { border-color: #9fd0f2; } .bg-swatch.active { border-color: #2b9ae8; } .bg-swatch.active::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #2b9ae8; text-shadow: 0 0 3px #fff; } .panel-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #555; margin-bottom: 8px; cursor: pointer; } .panel-check input { accent-color: #2b9ae8; } .small-btn { border: 1px solid #ccc; background: #fff; border-radius: 3px; cursor: pointer; font-size: 11px; padding: 4px 8px; color: #555; } .small-btn:hover { border-color: #2b9ae8; color: #2b9ae8; } .embed-actions { justify-content: flex-end; } .embed-hint { font-size: 11px; color: #999; line-height: 1.6; margin-top: 6px; } .embed-hint code { background: #f5f6f7; padding: 1px 4px; border-radius: 3px; } #statsPanel { right: 16px; top: 16px; width: 268px; max-height: 340px; display: flex; flex-direction: column; } #statsPanel .panel-title { flex: none; } #statsList { overflow: auto; flex: 1; } #findPanel { right: 16px; top: 16px; width: 280px; max-height: 380px; display: flex; flex-direction: column; } #findPanel .find-result { overflow: auto; flex: 1; margin-top: 4px; } #settingsPanel { right: 16px; top: 16px; } #infoPanel { right: 16px; top: 16px; width: 300px; max-height: 60%; display: flex; flex-direction: column; } #infoPanel .info-body { overflow: auto; } #propPanel { right: 16px; bottom: 130px; width: 280px; max-height: 46%; display: flex; flex-direction: column; } #propPanel .info-body { overflow: auto; } #embedPanel { right: 16px; top: 16px; width: 340px; } .stats-empty { color: #aaa; text-align: center; padding: 16px 0; font-size: 12px; } .stats-row { display: flex; align-items: center; gap: 6px; padding: 5px 2px; border-bottom: 1px solid #f5f6f7; font-size: 12px; } .stats-row:last-child { border-bottom: none; } .stats-type { color: #2b9ae8; flex: none; font-weight: 600; } .stats-value { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .stats-del { cursor: pointer; color: #bbb; flex: none; padding: 0 4px; } .stats-del:hover { color: #e74c3c; } .find-row { padding: 5px 4px; border-bottom: 1px solid #f5f6f7; font-size: 12px; cursor: pointer; } .find-row:hover { background: #f0f7fd; } .find-row .find-layer { color: #aaa; font-size: 11px; margin-left: 6px; } .info-body { font-size: 12px; color: #555; line-height: 1.9; } .info-body .kv { display: flex; gap: 8px; border-bottom: 1px dashed #f0f2f3; } .info-body .kv b { flex: none; width: 88px; font-weight: 400; color: #999; } .info-body .kv span { flex: 1; color: #333; word-break: break-all; } .info-body .lic { margin-top: 8px; color: #b58105; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 4px; padding: 6px 8px; line-height: 1.6; } /* ===== 测量 / 批注 子面板(水平单行,替换底部工具栏) ===== */ .measure-panel { left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px 8px; width: auto; max-width: 96vw; overflow-x: auto; } #measureModes, #annoModes { display: flex; gap: 2px; flex-wrap: nowrap; } .measure-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 72px; height: 78px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; cursor: pointer; color: #555; flex: none; gap: 4px; } .measure-btn img { width: 44px; height: 44px; } .measure-btn span { font-size: 13px; line-height: 1; } .measure-btn:hover { background: #f0f7fd; } .measure-btn.active { background: #2b9ae8; color: #fff; } .measure-btn.active img { filter: brightness(0) invert(1); } .measure-actions { display: flex; gap: 4px; align-items: center; margin-left: 6px; padding-left: 6px; border-left: 1px solid #eee; flex: none; } .measure-act { width: 58px; height: 58px; border: none; background: transparent; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; } .measure-act:hover { background: #f0f7fd; } .measure-act img { width: 36px; height: 36px; } #annoColor { width: 34px; height: 28px; border: 1px solid #ddd; border-radius: 4px; padding: 1px; cursor: pointer; } #annoWidth { border: 1px solid #ddd; border-radius: 4px; padding: 4px; font-size: 12px; } /* ===== 状态栏 ===== */ #statusbar { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: rgba(255,255,255,.92); border-top: 1px solid #e3e6e8; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 11px; color: #888; z-index: 44; } .status-mid { color: #555; font-family: Consolas, monospace; } .status-right { color: #2b9ae8; } /* ===== 加载遮罩 ===== */ #loading { position: fixed; inset: 0; background: rgba(255,255,255,.9); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; } .waiter { display: flex; gap: 12px; } .waiter > div { width: 18px; height: 18px; background-color: #2b9ae8; border-radius: 100%; animation: bouncedelay 1.4s infinite ease-in-out; animation-fill-mode: both; } .waiter .bounce1 { animation-delay: -0.75s; } .waiter .bounce2 { animation-delay: -0.5s; } .waiter .bounce3 { animation-delay: -0.25s; } @keyframes bouncedelay { 0% { transform: scale(0); } 50% { transform: scale(1); } 100% { transform: scale(0); } } #loadingText { color: #666; font-size: 14px; } /* ===== 拖拽遮罩 ===== */ #dropOverlay { position: fixed; inset: 0; background: rgba(43,154,232,.08); z-index: 300; display: flex; align-items: center; justify-content: center; } .drop-box { border: 2px dashed #2b9ae8; border-radius: 12px; background: #fff; padding: 50px 80px; font-size: 18px; color: #2b9ae8; pointer-events: none; } /* ===== 错误提示 ===== */ #errBox { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: #fff; border: 1px solid #ffccc7; border-radius: 6px; color: #cf1322; padding: 14px 20px; font-size: 13px; z-index: 210; box-shadow: 0 2px 12px rgba(0,0,0,.12); max-width: 70%; line-height: 1.7; } /* ===== 手机适配(≤768px) ===== */ .tree-close { display: none; } @media (max-width: 768px) { .tree-close { display: block; position: absolute; top: 12px; right: 10px; border: none; background: #f2f7fc; color: #6b8498; font-size: 14px; border-radius: 4px; padding: 2px 8px; cursor: pointer; } .tree-close:hover { background: #2b9ae8; color: #fff; } #topbar { height: 44px; gap: 8px; padding: 0 8px; } #topbar .logo-text { display: none; } #topbar .file-name { display: none; } #topbar .btn-primary, #topbar .btn-secondary { padding: 5px 10px; font-size: 12px; } #main { top: 44px; } body.embed #main { top: 0; } /* 图层抽屉:默认隐藏,点「图层」按钮弹出 */ #treePanel { position: fixed; top: 44px; left: 0; bottom: 0; width: min(280px, 85vw); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 2px 0 12px rgba(0,0,0,.15); } body.embed #treePanel { top: 0; } body.tree-open #treePanel { transform: translateX(0); } body.no-tree #treePanel { display: flex; } /* 手机上抽屉由 tree-open 控制 */ #viewport { left: 0; } body.no-tree #viewport { left: 0; } #toolbar { left: 0; right: 0; transform: none; bottom: 8px; max-width: none; border-radius: 0; border-left: none; border-right: none; padding: 2px 4px; } .tool-btn { width: 56px; height: 60px; } .tool-btn img { width: 32px; height: 32px; } .tool-btn span { font-size: 11px; } .float-panel { max-width: 92vw; max-height: 70vh; overflow: auto; } #errBox { max-width: 90%; } }