You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1501 lines
32 KiB

/* Preview Workbench — zero-invasion overlay around Creator preview */
/* 隐藏官方预览工具栏(仍保留 DOM 以免破坏预览注入) */
.pw-official-toolbar-hidden,
body > .toolbar,
body > #toolbar {
display: none !important;
height: 0 !important;
overflow: hidden !important;
margin: 0 !important;
padding: 0 !important;
border: none !important;
}
body {
display: flex;
flex-direction: column;
height: 100vh;
margin: 0;
}
.pw-check {
display: inline-flex;
align-items: center;
gap: 4px;
color: var(--pw-text, #ccc);
user-select: none;
}
.pw-check input { margin: 0; }
.pw-root {
--pw-bg: #1e1e1e;
--pw-panel: #252526;
--pw-border: #3c3c3c;
--pw-text: #cccccc;
--pw-muted: #858585;
--pw-accent: #3794ff;
--pw-danger: #f14c4c;
--pw-toolbar-h: 36px;
--pw-left-w: 240px;
--pw-right-w: 280px;
--pw-bottom-h: 220px;
position: relative;
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
height: auto;
color: var(--pw-text);
font: 12px/1.4 Consolas, "Courier New", monospace;
background: var(--pw-bg);
box-sizing: border-box;
}
.pw-root *,
.pw-root *::before,
.pw-root *::after {
box-sizing: border-box;
}
.pw-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: var(--pw-toolbar-h);
height: auto;
padding: 4px 10px;
background: #2d2d2d;
border-bottom: 1px solid var(--pw-border);
flex-shrink: 0;
z-index: 20;
}
.pw-toolbar-left,
.pw-toolbar-center,
.pw-toolbar-right {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
min-width: 0;
}
.pw-toolbar-left { flex: 1 1 0; justify-content: flex-start; }
.pw-toolbar-center { flex: 0 1 auto; justify-content: center; }
.pw-toolbar-right { flex: 1 1 0; justify-content: flex-end; }
.pw-brand {
font-weight: 700;
color: #fff;
margin-right: 4px;
}
.pw-status {
color: var(--pw-muted);
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pw-status.ok { color: #89d185; }
.pw-status.err { color: var(--pw-danger); }
/* 滑动开关(FPS 浮窗) */
.pw-switch {
display: inline-flex;
align-items: center;
gap: 6px;
cursor: pointer;
user-select: none;
color: var(--pw-text);
height: 22px;
}
.pw-switch input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.pw-switch-track {
position: relative;
width: 34px;
height: 18px;
border-radius: 999px;
background: #555;
border: 1px solid #666;
transition: background 0.15s ease, border-color 0.15s ease;
flex-shrink: 0;
}
.pw-switch-thumb {
position: absolute;
top: 1px;
left: 1px;
width: 14px;
height: 14px;
border-radius: 50%;
background: #ddd;
transition: transform 0.15s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.pw-switch input:checked + .pw-switch-track {
background: var(--pw-accent);
border-color: var(--pw-accent);
}
.pw-switch input:checked + .pw-switch-track .pw-switch-thumb {
transform: translateX(16px);
background: #fff;
}
.pw-switch-text {
font-size: 11px;
color: var(--pw-muted);
}
.pw-switch input:checked ~ .pw-switch-text {
color: #fff;
}
/* 全局暗色细滚动条 */
.pw-root,
.pw-root * {
scrollbar-width: thin;
scrollbar-color: #5a5a5a #1a1a1a;
}
.pw-root *::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.pw-root *::-webkit-scrollbar-track {
background: #1a1a1a;
border-radius: 4px;
}
.pw-root *::-webkit-scrollbar-thumb {
background: #4c4c4c;
border-radius: 4px;
border: 2px solid #1a1a1a;
background-clip: padding-box;
}
.pw-root *::-webkit-scrollbar-thumb:hover {
background: #6a6a6a;
border: 2px solid #1a1a1a;
background-clip: padding-box;
}
.pw-root *::-webkit-scrollbar-corner {
background: #1a1a1a;
}
.pw-btn {
appearance: none;
border: 1px solid var(--pw-border);
background: #333;
color: var(--pw-text);
padding: 2px 8px;
border-radius: 3px;
cursor: pointer;
font: inherit;
}
.pw-btn:hover { border-color: var(--pw-accent); }
.pw-btn.active {
background: var(--pw-accent);
border-color: var(--pw-accent);
color: #fff;
}
.pw-select {
background: #333;
color: var(--pw-text);
border: 1px solid var(--pw-border);
border-radius: 3px;
padding: 2px 4px;
font: inherit;
}
.pw-mode-toggle { display: inline-flex; gap: 0; }
.pw-mode-toggle .pw-btn { border-radius: 0; }
.pw-mode-toggle .pw-btn:first-child { border-radius: 3px 0 0 3px; }
.pw-mode-toggle .pw-btn:last-child { border-radius: 0 3px 3px 0; }
.pw-main {
display: flex;
flex: 1;
min-height: 0;
min-width: 0;
}
.pw-center {
position: relative;
flex: 1;
min-width: 120px;
min-height: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background: #000;
}
/* 尺寸一律由 device.js 按设备逻辑分辨率写入,禁止此处再用 auto/max 覆盖 */
.pw-dock {
background: var(--pw-panel);
border-color: var(--pw-border);
min-width: 0;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pw-dock-left {
width: var(--pw-left-w);
border-right: 1px solid var(--pw-border);
flex-shrink: 0;
}
.pw-dock-right {
width: var(--pw-right-w);
border-left: 1px solid var(--pw-border);
flex-shrink: 0;
}
.pw-dock-bottom {
height: var(--pw-bottom-h);
border-top: 1px solid var(--pw-border);
flex-shrink: 0;
}
.pw-dock.collapsed,
.pw-dock[hidden] {
display: none !important;
}
.pw-split {
background: var(--pw-border);
flex-shrink: 0;
z-index: 5;
}
.pw-split-v {
width: 4px;
cursor: col-resize;
}
.pw-split-h {
height: 4px;
cursor: row-resize;
}
.pw-split:hover { background: var(--pw-accent); }
.pw-panel {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.pw-panel[hidden] { display: none !important; }
.pw-panel-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
padding: 4px 8px;
background: #2d2d2d;
border-bottom: 1px solid var(--pw-border);
flex-shrink: 0;
}
.pw-panel-title { font-weight: 600; color: #fff; }
.pw-panel-body {
flex: 1;
min-height: 0;
overflow: auto;
padding: 6px 8px;
}
.pw-panel-tools {
display: flex;
flex-wrap: wrap;
gap: 4px;
align-items: center;
}
.pw-input {
background: #1a1a1a;
border: 1px solid var(--pw-border);
color: var(--pw-text);
border-radius: 3px;
padding: 2px 6px;
font: inherit;
min-width: 0;
}
.pw-input:focus {
outline: none;
border-color: var(--pw-accent);
}
.pw-row {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}
.pw-row label {
color: var(--pw-muted);
min-width: 64px;
}
.pw-hier-tree {
overflow: auto;
}
.pw-tree-item {
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 1px 6px 1px 0;
white-space: nowrap;
user-select: none;
height: 22px;
line-height: 22px;
}
.pw-tree-item:hover { background: #2a2d2e; }
.pw-tree-item.selected { background: #094771; }
.pw-tree-item.inactive { opacity: 0.45; }
.pw-tree-twist {
width: 14px;
height: 14px;
flex-shrink: 0;
border: none;
background: transparent;
color: #ccc;
padding: 0;
cursor: pointer;
font-size: 10px;
line-height: 14px;
text-align: center;
}
.pw-tree-twist.empty {
visibility: hidden;
}
.pw-tree-icon {
width: 14px;
height: 14px;
flex-shrink: 0;
display: inline-block;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.pw-tree-icon.scene { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23f0a020' d='M8 1c1.5 3 2 5 2 7a2 2 0 11-4 0c0-2 .5-4 2-7zm-3 9c0 2 1.5 4 3 5 1.5-1 3-3 3-5-.8.6-1.8 1-3 1s-2.2-.4-3-1z'/%3E%3C/svg%3E"); }
.pw-tree-icon.camera { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='4' width='10' height='8' rx='1' fill='%23f0a020'/%3E%3Cpath fill='%23f0a020' d='M11 7l4-2v6l-4-2z'/%3E%3C/svg%3E"); }
.pw-tree-icon.canvas { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='14' height='14' rx='1' fill='none' stroke='%236fcf97' stroke-width='1.5'/%3E%3Cpath stroke='%236fcf97' d='M1 5h14M5 1v14'/%3E%3C/svg%3E"); }
.pw-tree-icon.script { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ddd' d='M3 2h6l4 4v8H3V2zm6 0v4h4'/%3E%3C/svg%3E"); }
.pw-tree-icon.sprite { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='3' width='14' height='10' rx='1' fill='%23c586c0'/%3E%3Ccircle cx='5' cy='7' r='1.5' fill='%23222'/%3E%3Cpath fill='%23222' d='M1 11l4-3 3 2 4-4 3 3v2H1z'/%3E%3C/svg%3E"); }
.pw-tree-icon.label { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ctext x='3' y='13' font-size='12' font-family='Arial' fill='%23c586c0' font-weight='700'%3ET%3C/text%3E%3C/svg%3E"); }
.pw-tree-icon.ui { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2' y='2' width='12' height='12' rx='1' fill='none' stroke='%236fcf97' stroke-width='1.5'/%3E%3Crect x='5' y='5' width='6' height='6' fill='%236fcf97'/%3E%3C/svg%3E"); }
.pw-tree-icon.node { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='3' width='10' height='10' rx='1' fill='%23c586c0'/%3E%3C/svg%3E"); }
.pw-tree-name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.pw-tree-name.kind-scene { color: #f0a020; }
.pw-tree-name.kind-camera { color: #e0c080; }
.pw-tree-name.kind-canvas,
.pw-tree-name.kind-ui { color: #6fcf97; }
.pw-tree-name.kind-sprite,
.pw-tree-name.kind-label,
.pw-tree-name.kind-node { color: #c586c0; }
.pw-tree-name.kind-script { color: #dddddd; }
.pw-tree-item.selected .pw-tree-name { color: #fff; }
.pw-tree-ts {
flex-shrink: 0;
font-size: 10px;
font-weight: 700;
color: #fff;
background: #3794ff;
border-radius: 2px;
padding: 0 3px;
line-height: 14px;
height: 14px;
}
.pw-muted { color: var(--pw-muted); }
.pw-warn { color: #cca700; }
.pw-num { font-variant-numeric: tabular-nums; }
.pw-table {
width: 100%;
border-collapse: collapse;
}
.pw-table th,
.pw-table td {
text-align: left;
padding: 2px 4px;
border-bottom: 1px solid #333;
white-space: nowrap;
}
.pw-table tr:hover td { background: #2a2d2e; }
.pw-table tr.selected td { background: #094771; }
.pw-charts {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 8px;
}
.pw-chart-card {
background: #1a1a1a;
border: 1px solid var(--pw-border);
border-radius: 4px;
padding: 4px;
}
.pw-chart-card h4 {
margin: 0 0 4px;
font-size: 11px;
color: var(--pw-muted);
font-weight: 600;
}
.pw-chart-card canvas {
width: 100%;
height: 72px;
display: block;
}
.pw-summary {
display: flex;
flex-wrap: wrap;
gap: 8px 12px;
margin-bottom: 6px;
}
.pw-summary span { color: var(--pw-muted); }
.pw-summary b { color: #fff; font-weight: 600; }
.pw-pick-overlay {
position: fixed;
pointer-events: none;
z-index: 90;
box-sizing: border-box;
background: rgba(46, 204, 113, 0.38);
border: 1px solid rgba(39, 174, 96, 0.95);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
border-radius: 1px;
}
.pw-pick-overlay[hidden] {
display: none !important;
}
.pw-root.pw-inspect .pw-center #GameCanvas {
cursor: crosshair;
}
/* Compact */
.pw-compact-bar {
display: none;
flex-shrink: 0;
gap: 6px;
padding: 6px 8px;
background: #2d2d2d;
border-top: 1px solid var(--pw-border);
z-index: 20;
flex-wrap: wrap;
}
.pw-drawer {
position: fixed;
z-index: 40;
background: var(--pw-panel);
border: 1px solid var(--pw-border);
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.pw-drawer[hidden] { display: none !important; }
.pw-drawer-head {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px;
border-bottom: 1px solid var(--pw-border);
background: #2d2d2d;
}
.pw-drawer-body {
flex: 1;
min-height: 0;
overflow: auto;
}
.pw-root.pw-mode-compact .pw-compact-bar { display: flex; }
.pw-root.pw-mode-compact .pw-toolbar-left .pw-panel-btn { display: none; }
.pw-root.pw-mode-compact .pw-dock-left,
.pw-root.pw-mode-compact .pw-dock-right,
.pw-root.pw-mode-compact .pw-dock-bottom,
.pw-root.pw-mode-compact #pw-split-v1,
.pw-root.pw-mode-compact #pw-split-v2,
.pw-root.pw-mode-compact #pw-split-h {
display: none !important;
}
.pw-root.pw-mode-compact.pw-compact-portrait .pw-drawer {
left: 0;
right: 0;
bottom: 0;
height: 62%;
border-radius: 10px 10px 0 0;
}
.pw-root.pw-mode-compact.pw-compact-landscape .pw-drawer {
top: 40px;
right: 0;
bottom: 0;
width: min(420px, 70vw);
border-radius: 10px 0 0 10px;
}
/* —— 控制台(对齐 Chrome DevTools Console) —— */
.pw-console-list,
.pw-console-list * {
font-family: "Consolas", "Courier New", Menlo, Monaco, monospace !important;
}
.pw-console-list {
overflow: auto;
background: #202124;
font-size: 12px !important;
line-height: 1.4 !important;
color: #e8eaed;
padding: 0;
}
.pw-console-empty {
color: #9aa0a6;
padding: 10px 12px;
}
.pw-console-row {
display: flex;
align-items: flex-start;
gap: 6px;
padding: 3px 8px 3px 4px;
border-top: 1px solid transparent;
border-bottom: 1px solid #292a2d;
min-height: 20px;
}
.pw-console-row:hover { background: #292a2d; }
.pw-console-row.level-warn {
background: #332b00;
color: #fdd663;
border-top-color: #634b00;
border-bottom-color: #634b00;
}
.pw-console-row.level-error {
background: #4b1113;
color: #ffc7c7;
border-top-color: #8a1a1f;
border-bottom-color: #8a1a1f;
}
.pw-console-row.level-debug { color: #9aa0a6; }
.pw-console-icon {
flex: 0 0 14px;
width: 14px;
height: 14px;
margin-top: 3px;
background: center / 12px 12px no-repeat;
}
.pw-console-icon-warn {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23f29700' d='M8 1L1 14h14L8 1zm0 4l4.5 7h-9L8 5zm-.75 2v3h1.5V7h-1.5zM8 12a.9.9 0 110-1.8A.9.9 0 018 12z'/%3E%3C/svg%3E");
}
.pw-console-icon-error {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle fill='%23e81123' cx='8' cy='8' r='7'/%3E%3Cpath fill='%23fff' d='M5.2 4.5L4.5 5.2 7.3 8l-2.8 2.8.7.7L8 8.7l2.8 2.8.7-.7L8.7 8l2.8-2.8-.7-.7L8 7.3 5.2 4.5z'/%3E%3C/svg%3E");
}
.pw-console-icon-info {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle fill='%233794ff' cx='8' cy='8' r='7'/%3E%3Cpath fill='%23fff' d='M7.25 4h1.5v1.5h-1.5V4zM7.25 7h1.5v5h-1.5V7z'/%3E%3C/svg%3E");
}
.pw-console-count {
flex: 0 0 auto;
min-width: 16px;
height: 14px;
margin-top: 3px;
padding: 0 4px;
border-radius: 7px;
background: #3c4043;
color: #e8eaed;
font-size: 10px !important;
line-height: 14px;
text-align: center;
}
.pw-console-msg {
flex: 1;
min-width: 0;
white-space: pre-wrap;
word-break: break-word;
color: inherit;
}
.pw-console-toggle {
cursor: pointer;
display: inline-flex;
align-items: flex-start;
gap: 3px;
}
.pw-console-caret {
display: inline-block;
width: 0;
height: 0;
margin-top: 5px;
border-style: solid;
border-width: 4px 0 4px 6px;
border-color: transparent transparent transparent #9aa0a6;
transform: rotate(0deg);
}
.pw-console-toggle.open .pw-console-caret {
transform: rotate(90deg);
}
.pw-console-children {
margin: 2px 0 2px 12px;
padding-left: 8px;
border-left: 1px solid #3c4043;
}
.pw-console-prop { padding: 1px 0; }
.pw-console-stack {
margin: 4px 0 0;
padding: 0;
background: transparent;
color: inherit;
white-space: pre-wrap;
word-break: break-word;
}
.pw-v-fmt { color: inherit; }
.pw-v-text { color: #e8eaed; }
.pw-v-string { color: #f28b82; }
.pw-v-number { color: #a8c7fa; }
.pw-v-boolean { color: #c58af9; }
.pw-v-null,
.pw-v-undefined { color: #9aa0a6; }
.pw-v-function { color: #fdd663; }
.pw-v-object { color: #e8eaed; }
.pw-v-key { color: #a8c7fa; }
.pw-v-error { color: #ff8a80; }
.pw-v-symbol { color: #fdd663; }
.pw-v-muted { color: #9aa0a6; }
.pw-float-head {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 6px;
background: #2a2a2a;
border-bottom: 1px solid var(--pw-border);
cursor: move;
flex-shrink: 0;
}
.pw-float-title {
color: #fff;
font-weight: 600;
cursor: grab;
user-select: none;
padding: 2px 4px;
border-radius: 3px;
}
.pw-float-title:hover {
background: #3a3a3a;
}
.pw-float-title:active {
cursor: grabbing;
}
.pw-float-hint {
color: var(--pw-muted);
font-size: 10px;
margin-left: auto;
}
.pw-float-close {
flex-shrink: 0;
}
.pw-float-dock-dragging {
opacity: 0.4;
pointer-events: none !important;
}
.pw-float-body {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pw-float-body .pw-panel-root,
.pw-float-body .pw-panel-inner {
height: 100%;
min-height: 0;
}
.pw-preview-box {
width: 100%;
min-height: 80px;
background: #111;
border: 1px solid var(--pw-border);
display: flex;
align-items: center;
justify-content: center;
margin-top: 6px;
}
.pw-preview-box canvas {
max-width: 100%;
max-height: 160px;
}
.pw-field-grid {
display: grid;
grid-template-columns: 72px 1fr;
gap: 4px 6px;
align-items: center;
}
.pw-comp-block {
border: 1px solid var(--pw-border);
border-radius: 3px;
padding: 6px;
margin-bottom: 6px;
}
.pw-comp-block h5 {
margin: 0 0 4px;
color: #9cdcfe;
font-size: 12px;
}
/* —— 可拖拽停靠 —— */
.pw-dock {
display: flex;
flex-direction: column;
}
.pw-dock-tabs {
display: flex;
flex-wrap: wrap;
gap: 2px;
padding: 2px 4px;
background: #2a2a2a;
border-bottom: 1px solid var(--pw-border);
flex-shrink: 0;
min-height: 26px;
}
.pw-dock-tab {
appearance: none;
border: 1px solid transparent;
background: transparent;
color: var(--pw-muted);
padding: 2px 8px;
border-radius: 3px 3px 0 0;
cursor: pointer;
font: inherit;
}
.pw-dock-tab:hover { color: #fff; background: #333; }
.pw-dock-tab.active {
color: #fff;
background: var(--pw-panel);
border-color: var(--pw-border);
border-bottom-color: var(--pw-panel);
}
.pw-dock-body {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pw-panel-root,
.pw-dockable {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.pw-dockable-body {
flex: 1;
min-height: 0;
overflow: auto;
display: flex;
flex-direction: column;
}
.pw-drag-handle {
cursor: grab;
}
.pw-drag-handle:active { cursor: grabbing; }
.pw-dragging {
opacity: 0.55;
}
.pw-drop-zone {
position: absolute;
z-index: 50;
display: flex;
align-items: center;
justify-content: center;
background: rgba(55, 148, 255, 0.25);
border: 2px dashed var(--pw-accent);
color: #fff;
font-weight: 600;
pointer-events: auto;
}
.pw-drop-zone[hidden] {
display: none !important;
}
.pw-drop-zone.active {
background: rgba(55, 148, 255, 0.45);
}
.pw-drop-left {
left: 0;
top: 10%;
bottom: 10%;
width: 22%;
}
.pw-drop-right {
right: 0;
top: 10%;
bottom: 10%;
width: 22%;
}
.pw-drop-bottom {
left: 20%;
right: 20%;
bottom: 0;
height: 28%;
}
.pw-drop-float {
left: 30%;
right: 30%;
top: 20%;
height: 30%;
}
.pw-float-layer {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 30;
}
.pw-float-win {
position: absolute;
width: 320px;
height: 360px;
background: var(--pw-panel);
border: 1px solid var(--pw-accent);
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
pointer-events: auto;
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 4px;
}
.pw-float-win .pw-panel-root,
.pw-float-win .pw-dockable {
height: 100%;
}
/* —— 真实设备边框(纯 CSS:侧键 / 刘海 / 灵动岛 / Home) —— */
.pw-device-stage {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
background:
radial-gradient(ellipse at center, #2c2c30 0%, #0e0e10 72%);
}
.pw-device-scale {
position: absolute;
left: 8px;
bottom: 6px;
color: var(--pw-muted);
font-size: 11px;
z-index: 2;
pointer-events: none;
}
.pw-device-bezel {
--pw-shell-r: 40px;
--pw-screen-r: 30px;
--pw-bezel-x: 12px;
--pw-bezel-y: 12px;
position: relative;
box-sizing: border-box;
flex-shrink: 0;
transform: none !important;
background:
linear-gradient(145deg, #3f3f46 0%, #1c1c1f 42%, #2a2a2e 78%, #151518 100%);
border-radius: var(--pw-shell-r);
box-shadow:
0 0 0 1px #0a0a0a,
0 0 0 3px #4a4a50,
0 0 0 4px #1a1a1c,
0 18px 50px rgba(0, 0, 0, 0.65),
inset 0 1px 0 rgba(255, 255, 255, 0.18),
inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}
.pw-device-bezel.no-frame {
background: transparent !important;
border-radius: 0 !important;
padding: 0 !important;
box-shadow: none !important;
}
.pw-device-bezel.no-frame .pw-device-btn,
.pw-device-bezel.no-frame .pw-device-cutout,
.pw-device-bezel.no-frame .pw-device-home-bar,
.pw-device-bezel.no-frame .pw-device-home-btn,
.pw-device-bezel.no-frame .pw-device-ear {
display: none !important;
}
/* 侧键 */
.pw-device-btn {
position: absolute;
background: linear-gradient(180deg, #5a5a60, #2c2c30);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.25),
inset 0 -1px 0 rgba(0, 0, 0, 0.5),
0 0 0 1px #111;
z-index: 4;
pointer-events: none;
}
.pw-device-btn-silent {
left: -3px;
top: 18%;
width: 3px;
height: 4.5%;
border-radius: 2px 0 0 2px;
}
.pw-device-btn-volup {
left: -3px;
top: 26%;
width: 3px;
height: 7%;
border-radius: 2px 0 0 2px;
}
.pw-device-btn-voldown {
left: -3px;
top: 36%;
width: 3px;
height: 7%;
border-radius: 2px 0 0 2px;
}
.pw-device-btn-power {
right: -3px;
top: 28%;
width: 3px;
height: 10%;
border-radius: 0 2px 2px 0;
}
.pw-shell-android .pw-device-btn-silent { display: none; }
.pw-shell-android .pw-device-btn-volup { top: 22%; height: 8%; }
.pw-shell-android .pw-device-btn-voldown { top: 33%; height: 8%; }
.pw-shell-android .pw-device-btn-power { top: 24%; height: 12%; }
.pw-shell-tablet .pw-device-btn-silent,
.pw-shell-tablet .pw-device-btn-volup,
.pw-shell-tablet .pw-device-btn-voldown { display: none; }
.pw-shell-tablet .pw-device-btn-power {
top: 12%;
height: 6%;
}
.pw-device-bezel.is-landscape .pw-device-btn-silent {
left: 18%;
top: auto;
bottom: -3px;
width: 4.5%;
height: 3px;
border-radius: 0 0 2px 2px;
}
.pw-device-bezel.is-landscape .pw-device-btn-volup {
left: 26%;
top: auto;
bottom: -3px;
width: 7%;
height: 3px;
border-radius: 0 0 2px 2px;
}
.pw-device-bezel.is-landscape .pw-device-btn-voldown {
left: 36%;
top: auto;
bottom: -3px;
width: 7%;
height: 3px;
border-radius: 0 0 2px 2px;
}
.pw-device-bezel.is-landscape .pw-device-btn-power {
right: auto;
left: 28%;
top: -3px;
width: 10%;
height: 3px;
border-radius: 2px 2px 0 0;
}
/* 听筒(经典机) */
.pw-device-ear {
display: none;
position: absolute;
left: 50%;
top: 3.2%;
transform: translateX(-50%);
width: 16%;
height: 1.1%;
min-height: 4px;
background: #0c0c0e;
border-radius: 999px;
box-shadow: inset 0 0 0 1px #222;
z-index: 5;
pointer-events: none;
}
.pw-shell-classic .pw-device-ear { display: block; }
/* 刘海 / 灵动岛 / 打孔 */
.pw-device-cutout {
display: none;
position: absolute;
z-index: 6;
pointer-events: none;
background: #050505;
box-shadow: inset 0 0 0 1px #1a1a1a;
}
.pw-device-bezel.has-cutout .pw-device-cutout { display: block; }
.pw-device-bezel.has-notch .pw-device-cutout {
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 36%;
height: 22px;
border-radius: 0 0 14px 14px;
}
.pw-device-bezel.has-notch .pw-device-cutout::after {
content: '';
position: absolute;
right: 14%;
top: 50%;
width: 8px;
height: 8px;
margin-top: -4px;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #1e3a5f, #0a1520 70%);
box-shadow: 0 0 0 1px #222;
}
.pw-device-bezel.has-island .pw-device-cutout {
top: 12px;
left: 50%;
transform: translateX(-50%);
width: 28%;
max-width: 120px;
height: 24px;
border-radius: 999px;
}
.pw-device-bezel.has-island .pw-device-cutout::before {
content: '';
position: absolute;
right: 10px;
top: 50%;
width: 10px;
height: 10px;
margin-top: -5px;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, #243b55, #0a1018 70%);
}
.pw-device-bezel.has-punch .pw-device-cutout {
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 10px;
height: 10px;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #1a3350, #05080c 75%);
}
/* Home 指示条 / 实体 Home 键 */
.pw-device-home-bar {
display: none;
position: absolute;
left: 50%;
bottom: 7px;
transform: translateX(-50%);
width: 34%;
max-width: 140px;
height: 4px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.35);
z-index: 6;
pointer-events: none;
}
.pw-device-bezel.has-home-bar:not(.is-landscape) .pw-device-home-bar {
display: block;
}
.pw-device-home-btn {
display: none;
position: absolute;
left: 50%;
bottom: 2.6%;
transform: translateX(-50%);
width: 14%;
aspect-ratio: 1;
max-width: 52px;
border-radius: 50%;
background:
radial-gradient(circle at 50% 42%, #3a3a40 0%, #1a1a1e 62%, #0c0c0e 100%);
box-shadow:
inset 0 0 0 2px #4a4a50,
inset 0 0 0 4px #1c1c1f,
0 0 0 1px #0a0a0a;
z-index: 6;
pointer-events: none;
}
.pw-device-bezel.has-home-btn:not(.is-landscape) .pw-device-home-btn {
display: block;
}
.pw-device-bezel.is-landscape.has-home-btn .pw-device-home-btn {
display: block;
left: auto;
right: 2.6%;
bottom: 50%;
transform: translateY(50%);
width: auto;
height: 14%;
aspect-ratio: 1;
}
.pw-device-screen {
overflow: hidden;
border-radius: var(--pw-screen-r, 8px);
background: #000;
position: relative;
flex-shrink: 0;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.pw-device-bezel.no-frame .pw-device-screen {
border-radius: 0;
}
.pw-device-screen #content,
.pw-device-screen .contentWrap,
.pw-device-screen #GameDiv,
.pw-device-screen #Cocos3dGameContainer,
.pw-device-screen #GameCanvas {
width: 100% !important;
height: 100% !important;
max-width: none !important;
max-height: none !important;
margin: 0 !important;
box-sizing: border-box !important;
}
.pw-device-screen #content,
.pw-device-screen .contentWrap,
.pw-device-screen #GameDiv,
.pw-device-screen #Cocos3dGameContainer {
position: absolute !important;
left: 0 !important;
top: 0 !important;
right: 0 !important;
bottom: 0 !important;
overflow: hidden !important;
}
.pw-device-screen #GameCanvas {
position: absolute !important;
left: 0 !important;
top: 0 !important;
display: block !important;
}
.pw-center {
position: relative;
width: 100%;
height: 100%;
}
/* —— 布局 v3:递归停靠树 —— */
.pw-workspace {
flex: 1;
min-height: 0;
min-width: 0;
display: flex;
position: relative;
overflow: hidden;
background: #111;
}
.pw-game-host {
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
}
.pw-game-host.pw-game-compact {
flex: 1;
}
.pw-split-node {
display: flex;
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
}
.pw-split-node.pw-split-h { flex-direction: row; }
.pw-split-node.pw-split-v { flex-direction: column; }
.pw-split-child {
display: flex;
min-width: 0;
min-height: 0;
overflow: hidden;
}
.pw-splitter {
flex: 0 0 4px;
background: var(--pw-border);
z-index: 6;
}
.pw-splitter-h { cursor: col-resize; }
.pw-splitter-v { cursor: row-resize; }
.pw-splitter:hover { background: var(--pw-accent); }
.pw-leaf {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
min-width: 0;
min-height: 0;
background: var(--pw-panel);
border: 1px solid #1a1a1a;
position: relative;
}
.pw-leaf-game {
background: #000;
border-color: #000;
}
.pw-leaf-tabbar {
display: flex;
flex-wrap: wrap;
gap: 2px;
padding: 2px 4px;
background: #2a2a2a;
border-bottom: 1px solid var(--pw-border);
flex-shrink: 0;
min-height: 26px;
}
.pw-leaf-tab {
appearance: none;
border: 1px solid transparent;
background: transparent;
color: var(--pw-muted);
padding: 2px 10px;
border-radius: 3px 3px 0 0;
cursor: grab;
font: inherit;
}
.pw-leaf-tab:hover { color: #fff; background: #333; }
.pw-leaf-tab.active {
color: #fff;
background: var(--pw-panel);
border-color: var(--pw-border);
border-bottom-color: var(--pw-panel);
}
.pw-leaf-body {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pw-panel-toolbar {
display: flex;
flex-wrap: wrap;
gap: 4px;
padding: 4px 6px;
border-bottom: 1px solid var(--pw-border);
background: #2d2d2d;
flex-shrink: 0;
}
.pw-panel-root {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.pw-panel-root .pw-panel-body,
.pw-panel-root .pw-hier-tree {
flex: 1;
min-height: 0;
}
.pw-drop-overlay {
position: absolute;
z-index: 80;
pointer-events: none;
box-sizing: border-box;
}
.pw-drop-overlay[hidden] {
display: none !important;
}
.pw-drop-edge {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
background: rgba(55, 148, 255, 0.18);
border: 2px dashed transparent;
color: transparent;
font-size: 12px;
font-weight: 600;
}
.pw-drop-e-center { inset: 22%; }
.pw-drop-e-left { left: 0; top: 0; bottom: 0; width: 22%; }
.pw-drop-e-right { right: 0; top: 0; bottom: 0; width: 22%; }
.pw-drop-e-top { left: 0; right: 0; top: 0; height: 22%; }
.pw-drop-e-bottom { left: 0; right: 0; bottom: 0; height: 22%; }
.pw-drop-overlay.edge-center .pw-drop-e-center,
.pw-drop-overlay.edge-left .pw-drop-e-left,
.pw-drop-overlay.edge-right .pw-drop-e-right,
.pw-drop-overlay.edge-top .pw-drop-e-top,
.pw-drop-overlay.edge-bottom .pw-drop-e-bottom {
background: rgba(55, 148, 255, 0.45);
border-color: var(--pw-accent);
color: #fff;
}
.pw-drop-overlay.is-game .pw-drop-e-center {
display: none;
}
/* 组停靠:整条带就是新建区预览 */
.pw-drop-overlay.is-region .pw-drop-e-center {
inset: 0;
}
.pw-drop-overlay.is-region .pw-drop-e-left,
.pw-drop-overlay.is-region .pw-drop-e-right,
.pw-drop-overlay.is-region .pw-drop-e-top,
.pw-drop-overlay.is-region .pw-drop-e-bottom {
display: none;
}
.pw-root.pw-mode-compact .pw-workspace {
flex: 1;
}