.node.branch{min-height:0}
.node.branch .node-body{max-height:none;overflow:visible;padding-bottom:10px}
.node.branch .branch-choice{min-height:27px}
.wire.preview{stroke:#ffb452;stroke-width:3;stroke-dasharray:7 5;opacity:.95}
.wire{pointer-events:stroke;cursor:pointer}
#wireLayer{z-index:2}
#canvas{z-index:3;pointer-events:none}
.node{pointer-events:auto}
.node.comment{width:250px;background:#322b3a;border-color:#8b6aa5}
.node.comment .node-head{border-left:4px solid #c084fc;background:#4a3b5b}
.node.comment .node-body{max-height:none;color:#eadcff}
.node-tool.comment{border-left-color:#c084fc}
.scene-banner{height:96px;border-radius:7px 7px 0 0;background:#111827;position:relative;display:flex;align-items:flex-end;justify-content:center;overflow:hidden}
.scene-banner img{width:100%;height:100%;object-fit:contain;object-position:center;display:block}
.scene-banner:before{content:"";position:absolute;inset:0;background:linear-gradient(transparent 28%,rgba(8,12,20,.88))}
.scene-banner span{position:relative;padding:6px 10px;font-size:11px;color:#fff;text-shadow:0 1px 2px #000}
.scene-banner + .node-head{border-radius:0}
.option-card header{display:flex;gap:6px;align-items:center;padding:0 0 6px}
.option-card header .option-name{margin:0;min-width:0;font-weight:bold}
.inspector-section{margin:12px 0;padding:10px;border:1px solid #46536b;border-radius:6px;background:rgba(14,19,29,.28)}
.inspector-section h3{margin:0 0 9px;color:#f3f6fb;font-size:13px;border-left:3px solid #60a5fa;padding-left:7px}
.inspector-section h3 small{font-size:10px;color:#94a3b8;font-weight:normal;margin-left:4px}
.inspector-section h4{margin:0 0 7px;color:#9fb0c9;font-size:11px;font-weight:normal;padding-bottom:5px;border-bottom:1px solid #39465c}
.inspector-section label{margin-top:8px}
.extra-effect{margin-top:10px;padding:8px;border:1px solid #43516c;border-radius:6px;background:#182131}
.extra-effect h4{margin:0 0 6px;display:flex;justify-content:space-between;align-items:center;color:#b9c9e8}
.extra-effect h4 button{min-width:28px;padding:1px 6px}
.add-effect{width:100%;margin-top:8px}
.toolbar-themes{margin-left:auto;display:flex;align-items:center;gap:5px;font-size:11px;color:#c7d2e5;white-space:nowrap}
.toolbar-themes button{padding:4px 7px;font-size:11px;background:#30394b}
.toolbar-themes button.active{border-color:#f6c46f;color:#fff;background:#4a5872}
header.toolbar-orange{background:#9a571e;border-bottom-color:#d8924c}
header.toolbar-orange .toolbar-themes button{background:#7c4012;border-color:#d8924c}
header.toolbar-orange .toolbar-themes button.active{background:#d47727;border-color:#ffe0ae}
header.toolbar-sky{background:#4f7d9e;border-bottom-color:#9fd3ef}
header.toolbar-sky .toolbar-themes button{background:#396783;border-color:#8cc8e8}
header.toolbar-sky .toolbar-themes button.active{background:#6da8c9;border-color:#e0f5ff}
.node-tool{display:flex;align-items:center;gap:7px}
.node-tool img{width:18px;height:18px;object-fit:contain;flex:0 0 18px}
.projectbar{gap:8px;align-items:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.projectbar>*{flex:0 0 auto;min-width:0;white-space:nowrap}
.projectbar strong{max-width:150px;overflow:hidden;text-overflow:ellipsis}
.projectbar select{max-width:min(360px,30vw)}
#chapterDuration{color:#f6c46f;font-weight:700;white-space:nowrap}
.reading-speed{display:flex;align-items:center;gap:4px;color:#aebdd4;font-size:12px;white-space:nowrap}
.reading-speed input{width:52px;padding:3px 4px;background:#202b3d;color:#e8eef9;border:1px solid #52617b;border-radius:4px}
button.compact{padding:4px 8px;font-size:12px;white-space:nowrap}
.pacing-dialog{position:fixed;inset:0;z-index:50;background:rgba(4,8,15,.68);display:grid;place-items:center;padding:20px}
.pacing-dialog[hidden]{display:none}
.pacing-card{width:min(720px,94vw);max-height:78vh;overflow:auto;background:#182131;border:1px solid #60708d;border-radius:9px;box-shadow:0 24px 70px rgba(0,0,0,.48);padding:16px}
.pacing-card>header{display:flex;position:static;background:none;border:0;align-items:center;justify-content:space-between;padding:0 0 11px;margin-bottom:10px;border-bottom:1px solid #3e4a60}
.pacing-card h2{font-size:17px;margin:0;color:#f7f9fe}
.pacing-card>header button{min-width:30px;padding:1px 6px;font-size:20px;line-height:24px}
.pacing-overview{display:flex;flex-wrap:wrap;gap:9px;background:#202c40;border:1px solid #42516d;border-radius:6px;padding:10px 12px;color:#dce8fc}
.pacing-overview strong{color:#f6c46f;width:100%}
.pacing-overview span{font-size:12px;color:#b7c8e3}
.pacing-route{margin:11px 0;padding:10px 12px;border-left:3px solid #5b9eff;background:#141d2b;border-radius:4px}
.pacing-route h3{margin:0 0 7px;font-size:13px;color:#ebf1ff}
.pacing-route h3 small{margin-left:7px;color:#91a6c6;font-weight:normal}
.pacing-route ul{margin:0;padding-left:18px;color:#ffd28c;font-size:12px;line-height:1.65}
.pacing-pass{margin:0;color:#80d5a2;font-size:12px}
.pacing-note{margin:12px 0 0;color:#8292ad;font-size:11px;line-height:1.6}
@media (max-width:1180px){.projectbar strong{max-width:105px}.projectbar select{max-width:220px}.reading-speed{font-size:11px}.projectbar{padding:0 10px}}

/* iPad / PWA：横屏优先，竖屏时属性栏改为侧滑抽屉。 */
.inspector-toggle{display:none}
@media (max-width:1050px){
  header{gap:12px;padding:0 10px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
  header .brand{font-size:16px;flex:0 0 auto}
  header nav{flex:0 0 auto}
  header nav button{padding:6px 8px;white-space:nowrap}
  .toolbar-themes{display:none}
  main{grid-template-columns:164px 1fr}
  .palette{padding:10px}
  .palette .help{display:none}
  .node-tool{padding:9px 7px;font-size:13px}
  .inspector{position:fixed;z-index:35;right:0;top:52px;bottom:0;width:min(330px,88vw);transform:translateX(102%);transition:transform .2s ease;box-shadow:-12px 0 30px rgba(0,0,0,.35)}
  body.inspector-open .inspector{transform:translateX(0)}
  .inspector-toggle{display:inline-block}
  #canvasViewport{touch-action:none}
  .projectbar{height:48px;padding:0 9px}
  .projectbar strong{max-width:95px}
  .projectbar select{max-width:190px}
  .projectbar #zoomLabel{margin-left:0}
}
@media (max-width:760px){
  header{height:48px;gap:8px}
  header .brand small{display:none}
  header nav button{font-size:12px;padding:5px 7px}
  main{height:calc(100vh - 48px);grid-template-columns:132px 1fr}
  .palette{padding:8px}
  .palette h2{font-size:13px}
  .palette .hint{font-size:11px}
  .node-tool{font-size:0;padding:9px 5px;text-align:center;border-left-width:3px}
  .node-tool img{width:22px;height:22px;margin:auto}
  .node-tool::after{content:attr(data-type);display:block;font-size:10px;color:#dce7f8;margin-top:3px}
  .node-tool[data-type="dialogue"]::after{content:"对话"}.node-tool[data-type="branch"]::after{content:"分支"}.node-tool[data-type="reward"]::after{content:"奖励"}.node-tool[data-type="calc"]::after{content:"条件"}.node-tool[data-type="comment"]::after{content:"注释"}.node-tool[data-type="end"]::after{content:"结束"}
  .projectbar{gap:6px}
  .projectbar #chapterWords,.projectbar #projectWords{display:none}
  .reading-speed{display:none}
  .projectbar strong{max-width:72px;font-size:13px}
  .projectbar select{max-width:126px;font-size:12px}
  #chapterDuration{font-size:11px}
  .pacing-card{max-height:84vh;padding:13px}
}
