:root{--ink:#17212b;--muted:#7d8996;--line:#e4e9ee;--teal:#4f46e5;--teal-dark:#4338ca;--sidebar:#fff;--bg:#f4f6f8;--canvas:#fbfcfd}
*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}button,input{font:inherit}button{cursor:pointer;border:0;background:none;color:inherit}.app-shell{height:100%;display:flex;flex-direction:column;overflow:hidden}.topbar{height:68px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 24px;gap:32px;flex:0 0 auto}.brand-lockup{display:flex;align-items:center;gap:10px;min-width:230px}.brand-mark{width:32px;height:32px;border-radius:8px;background:#6366f1;color:white;display:grid;place-items:center;font-weight:800;font-size:18px;box-shadow:0 4px 8px #6366f133}.brand-name{font-size:17px;font-weight:750;letter-spacing:.2px}.brand-sub{font-size:10px;color:#9aa5ae;letter-spacing:.2px;margin-top:1px}.board-title-wrap{display:flex;align-items:center;gap:12px;flex:1}.board-title{border:0;font-weight:650;font-size:16px;background:transparent;outline:none;padding:6px 2px;width:210px}.board-title:focus{border-bottom:2px solid #c7d2fe}.saved-state{color:#89949f;font-size:12px;display:flex;align-items:center;gap:6px}.status-dot{width:7px;height:7px;background:#10b981;border-radius:50%;display:inline-block}.top-actions{display:flex;align-items:center;gap:8px}.icon-btn,.ghost-btn{color:#8b96a1;font-size:20px;width:30px;height:30px;border-radius:6px;display:grid;place-items:center}.icon-btn:hover,.ghost-btn:hover{background:#eef2ff;color:var(--teal)}.ghost-btn{font-size:18px}.zoom-value{font-size:12px;color:#65717d;min-width:38px;text-align:center}.divider{height:22px;width:1px;background:var(--line);margin:0 6px}.outline-btn,.primary-btn{height:34px;border-radius:6px;padding:0 13px;font-size:12px;font-weight:600}.outline-btn{border:1px solid #cbd4dc;color:#53616d;background:#fff}.outline-btn:hover{background:#eef2ff;border-color:#a5b4fc}.primary-btn{background:var(--teal);color:#fff}.primary-btn:hover{background:var(--teal-dark)}.workspace{display:flex;flex:1;min-height:0}.left-panel,.right-panel{background:#fff;width:254px;flex:0 0 254px;display:flex;flex-direction:column}.left-panel{border-right:1px solid var(--line);padding:23px 18px 16px}.right-panel{border-left:1px solid var(--line);padding:23px 18px 16px}.panel-heading,.inspector-head{display:flex;align-items:flex-start;justify-content:space-between}.eyebrow{font-size:10px;letter-spacing:1.4px;color:#9aa5ae;font-weight:650}.panel-heading h2,.inspector-head h2{font-size:18px;margin:4px 0 0;font-weight:700}.collapse-btn{font-size:26px;line-height:22px;color:#b3bdc5;padding:0 3px}.search-box{height:34px;border:1px solid var(--line);border-radius:6px;display:flex;align-items:center;gap:8px;padding:0 10px;margin:22px 0 21px;color:#a0aab3}.search-box input{border:0;outline:none;width:100%;font-size:12px;color:var(--ink)}.search-box input::placeholder{color:#aab3ba}.section-label{font-size:11px;color:#9da7b0;font-weight:650;margin-bottom:11px}.shape-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 9px}.shape-item{color:#63707b;font-size:11px;display:flex;flex-direction:column;align-items:center;gap:7px;user-select:none}.shape-item span{white-space:nowrap}.shape-preview{width:84px;height:40px;border:1px solid #c9d3d9;display:grid;place-items:center;color:#52626f;font-size:11px;background:#fff;transition:.16s}.shape-item:hover .shape-preview{border-color:#6366f1;box-shadow:0 2px 7px #6366f11f;transform:translateY(-1px)}.shape-preview.terminator{border-radius:22px;background:#cff0d6;border-color:#9dcec0}.shape-preview.process{border-radius:4px;background:#e7f0ff;border-color:#a9c0e4}.shape-preview.decision{transform:rotate(45deg);width:40px;height:40px;background:#fff2d9;border-color:#dabe83}.shape-preview.decision::first-line{transform:rotate(-45deg)}.shape-preview.io{clip-path:polygon(14% 0,100% 0,86% 100%,0 100%);background:#f9e6ea;border:0}.shape-preview.delay{border-radius:4px 18px 18px 4px;background:#eee9fa;border-color:#c6b9e2}.shape-preview.note{background:#fff8df;border-color:#dccb87;border-radius:2px;clip-path:polygon(0 0,76% 0,100% 25%,100% 100%,0 100%)}.templates{border-top:1px solid var(--line);padding-top:20px;margin-top:23px}.template-item{width:100%;display:flex;align-items:center;gap:10px;text-align:left;padding:9px 6px;border-radius:6px;color:#52606c}.template-item:hover{background:#eef2ff}.template-icon{width:27px;height:27px;border-radius:6px;display:grid;place-items:center;background:#eef2ff;color:var(--teal);font-size:15px}.template-item strong{font-size:12px;display:block;font-weight:650}.template-item small{font-size:10px;color:#9aa5ae;display:block;margin-top:3px}.template-arrow{margin-left:auto;color:#b7c0c7;font-size:20px}.left-tip{margin-top:auto;border-top:1px solid var(--line);padding-top:15px;display:flex;gap:9px;color:#9aa5ae;font-size:10px;line-height:1.6}.left-tip>span:first-child{font-size:15px;color:#818cf8}.canvas-area{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--canvas)}.canvas-viewport{position:relative;flex:1;overflow:auto;background:#f8fafb}.board{display:block;background:#fbfcfd;margin:0 auto;border:0;box-shadow:none}.canvas-viewport.connect-mode{cursor:crosshair}.canvas-footer{height:31px;border-top:1px solid var(--line);background:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 21px;font-size:10px;color:#a0aab3}.empty-hint{position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;color:#a6b1ba;pointer-events:none}.empty-hint strong{font-size:13px;color:#76838e;margin-top:8px}.empty-hint span{font-size:11px;margin-top:4px}.empty-icon{width:45px;height:45px;border:1px dashed #b8c6cc;border-radius:10px;display:grid;place-items:center;color:#818cf8;font-size:20px}.inspector-head{padding-bottom:20px;border-bottom:1px solid var(--line)}.no-selection{display:flex;flex-direction:column;align-items:center;text-align:center;color:#9da7b0;padding-top:92px}.cursor-icon{width:40px;height:40px;border-radius:50%;background:#f1f5f6;color:#818cf8;font-size:22px;display:grid;place-items:center;margin-bottom:12px}.no-selection strong{color:#727f89;font-size:13px}.no-selection span{font-size:11px;margin-top:5px}.node-editor{padding-top:20px}.hidden{display:none!important}.selected-preview{height:78px;border-radius:7px;background:#cff0d6;border:1px solid #a5b4fc;display:grid;place-items:center;font-size:13px;font-weight:650;color:#3730a3;margin-bottom:20px}.field{margin-bottom:18px}.field label{font-size:11px;color:#7f8a94;display:block;margin-bottom:7px}.field input{width:100%;height:33px;border:1px solid #d8e0e5;border-radius:5px;padding:0 9px;outline:none;color:#3d4b56;font-size:12px}.field input:focus{border-color:#a5b4fc;box-shadow:0 0 0 3px #6366f114}.color-row{display:flex;gap:8px}.color-row button{width:24px;height:24px;border-radius:50%;background:var(--swatch);border:2px solid #fff;box-shadow:0 0 0 1px #d4dce1}.color-row button.active{box-shadow:0 0 0 2px var(--teal)}.position-row{display:flex;gap:8px}.position-row input{width:50%}.type-chip{display:inline-flex;background:#f1f5f6;color:#6c7983;border-radius:4px;padding:6px 9px;font-size:11px}.delete-btn{height:33px;border:1px solid #f0cfd0;color:#c5676a;border-radius:5px;width:100%;font-size:12px;margin-top:2px}.delete-btn:hover{background:#fff5f5}.inspector-foot{margin-top:auto;padding-top:14px;border-top:1px solid var(--line);font-size:10px;color:#a2acb4}.inspector-foot span{background:#f0f3f5;color:#78858f;border-radius:3px;padding:3px 5px;margin-right:5px}.edge-line{stroke:#8b98a4;stroke-width:2;fill:none;marker-end:url(#arrow)}.edge-line.selected{stroke:var(--teal)}.node{cursor:move;filter:url(#nodeShadow)}.node.selected .node-body{stroke:#6366f1;stroke-width:2.2}.node-body{stroke:#aab9be;stroke-width:1.4}.node-label{font-size:13px;fill:#30404b;pointer-events:none;user-select:none}.decision-label{font-size:12px}.port{fill:#fff;stroke:#6366f1;stroke-width:1.3;opacity:0}.node:hover .port,.node.selected .port{opacity:1}.port-dot{fill:#6366f1}.edge-label{font-size:11px;fill:#81909a}.toast{position:fixed;bottom:50px;left:50%;transform:translateX(-50%) translateY(15px);background:#26353f;color:#fff;padding:9px 15px;border-radius:5px;font-size:12px;opacity:0;pointer-events:none;transition:.22s;z-index:10}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:1000px){.left-panel{width:210px;flex-basis:210px}.right-panel{width:220px;flex-basis:220px}.topbar{gap:15px;padding:0 14px}.brand-lockup{min-width:190px}.board-title-wrap{display:none}.outline-btn{display:none}}
@media(max-width:720px){.left-panel{width:180px;flex-basis:180px;padding-left:12px;padding-right:12px}.right-panel{display:none}.top-actions{margin-left:auto}.shape-preview{width:70px}.topbar{height:58px}.brand-lockup{min-width:0}.brand-sub{display:none}}
.edge-editor{padding-top:20px}.line-preview{height:78px;border:1px solid #d9e2e5;border-radius:7px;background:#f8fafb;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#63727d;font-size:12px;margin-bottom:20px}.line-preview-stroke{width:118px;height:0;border-top:2px solid #8b98a4;position:relative}.line-preview-stroke:after{content:"";position:absolute;right:-1px;top:-5px;border-left:7px solid #8b98a4;border-top:4px solid transparent;border-bottom:4px solid transparent}.line-colors button{background:var(--swatch)}.line-style-toggle{display:grid;grid-template-columns:1fr 1fr;gap:6px}.line-style-toggle button{height:33px;border:1px solid #d8e0e5;border-radius:5px;color:#64727c;font-size:12px;background:#fff}.line-style-toggle button:hover,.line-style-toggle button.active{border-color:#818cf8;background:#e0e7ff;color:#4f46e5;font-weight:650}.canvas-viewport{cursor:grab}.canvas-viewport.panning{cursor:grabbing}.node,.resize-handle,.port{touch-action:none}
.line-preview-stroke{border-top-color:var(--line-color,#8b98a4)}.line-preview-stroke:after{border-left-color:var(--line-color,#8b98a4)}
.node.connectable .port{opacity:1}
.port,.port-plus{cursor:cell}
.port{fill:#fff;stroke:#4f46e5;stroke-width:2}.port-plus{font-size:12px;font-weight:700;fill:#4f46e5;pointer-events:none;user-select:none}.node:hover .port{opacity:1}.node:hover .port-plus{opacity:1}
.connection-preview{fill:none;stroke:#6366f1;stroke-width:2;marker-end:url(#arrow);pointer-events:none}.align-guide{stroke:#818cf8;stroke-width:1;stroke-dasharray:5 5;opacity:.8;pointer-events:none}.curve-handle{fill:#fff;stroke:#6366f1;stroke-width:2;cursor:ns-resize}.edge-line{pointer-events:stroke;cursor:pointer}
.canvas-viewport{cursor:default}.canvas-viewport.panning{cursor:grabbing}
/* 命中层宽度保持 20 不变：之前 hover 收缩到 7px 会让鼠标在命中带边缘
   反复进出（进→收缩→脱出→还原→再进），光标在手指/箭头间闪烁 */
.edge-hit{fill:none;stroke:#4f46e5;stroke-width:20;opacity:.001;pointer-events:all;cursor:pointer;transition:opacity .16s}
.edge-hit:hover{opacity:.14;filter:drop-shadow(0 3px 4px rgba(49,65,88,.28))}
.node-editor{overflow-y:auto;padding-right:2px}.font-selects{display:grid;grid-template-columns:minmax(0,1fr) 68px;gap:7px;margin-bottom:8px}.font-selects select{height:33px;border:1px solid #d8e0e5;border-radius:5px;padding:0 7px;background:#fff;color:#3d4b56;font-size:12px;outline:none;min-width:0}.font-selects select:focus{border-color:#a5b4fc;box-shadow:0 0 0 3px #6366f114}.format-row{display:flex;gap:6px}.format-button{width:34px;height:32px;border:1px solid #d8e0e5;border-radius:5px;background:#fff;display:grid;place-items:center;color:#4d5b65;font-family:Arial,sans-serif;font-size:15px;font-weight:600;position:relative}.format-button:hover{border-color:#a5b4fc;background:#eef2ff}.format-button.active{border-color:#818cf8;background:#e0e7ff;color:#4f46e5}.italic-icon{font-family:Georgia,serif;font-style:italic}.color-picker{cursor:pointer;grid-template-rows:1fr 3px;padding:4px 8px 3px}.color-picker span{width:16px;height:3px;background:var(--font-color,#30404b);border-radius:1px}.color-picker input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.selection-outline{fill:none;stroke:#6366f1;stroke-width:1.4;stroke-dasharray:5 4;pointer-events:none}.resize-handle{fill:#fff;stroke:#6366f1;stroke-width:1.8}.resize-handle[data-dir="nw"],.resize-handle[data-dir="se"]{cursor:nwse-resize}.resize-handle[data-dir="ne"],.resize-handle[data-dir="sw"]{cursor:nesw-resize}
.shape-preview.decision{transform:none!important;width:84px!important;height:40px!important;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);border:0;background:#fff2d9}.shape-preview.decision::first-line{transform:none!important}
.shape-item:hover .shape-preview.decision{transform:translateY(-1px)!important;background:#ffebbd;filter:drop-shadow(0 3px 4px rgba(79,70,229,.22))}.edge-line.selected{stroke-width:4;filter:drop-shadow(0 0 3px rgba(79,70,229,.65))}
#alignRightBtn{display:none}
.inline-editor{display:none;position:absolute;z-index:4;min-height:32px;min-width:80px;border:0;border-bottom:1px solid #4f46e5;border-radius:0;background:transparent;text-align:center;padding:5px;outline:none;color:#30404b;caret-color:#4f46e5;resize:none;overflow:hidden;line-height:1.35}.resize-handle[data-dir="n"],.resize-handle[data-dir="s"]{cursor:ns-resize}.resize-handle[data-dir="e"],.resize-handle[data-dir="w"]{cursor:ew-resize}
.node{filter:drop-shadow(0 5px 6px rgba(49,65,88,.21))}.node:hover{filter:drop-shadow(0 7px 8px rgba(49,65,88,.27))}.node .node-body{stroke:#8798a2;stroke-width:1.8}.node.selected .node-body{stroke:#4f46e5;stroke-width:2.4}
.route-handle{fill:#fff;stroke:#4f46e5;stroke-width:2;cursor:move;filter:drop-shadow(0 2px 3px rgba(49,65,88,.2))}
.right-panel.inspector-hidden{display:none}
.marquee-rect{fill:rgba(99,102,241,.09);stroke:#6366f1;stroke-width:1.4;stroke-dasharray:6 4;pointer-events:none}
.group-selection-outline{stroke-width:1.8;stroke-dasharray:7 4}
.group-resize-handle{fill:#6366f1;stroke:#fff;stroke-width:2;filter:drop-shadow(0 2px 3px rgba(49,65,88,.24))}
.connection-preview.snapped{stroke-width:2.7;stroke-dasharray:none;filter:drop-shadow(0 2px 3px rgba(99,102,241,.28))}
.port.port-target{fill:#e0e7ff;stroke-width:3;filter:drop-shadow(0 0 4px rgba(99,102,241,.45))}
.port{fill:rgba(255,255,255,.88);stroke:rgba(79,70,229,.66);stroke-width:1.5}
.node:hover .port,.node.selected .port,.node.connectable .port{opacity:.72}
.port:hover,.port.port-target{opacity:1}
.port-plus{opacity:.62;fill:#4f46e5;font-size:11px}
.inline-editor{min-width:64px;min-height:28px;padding:3px 7px;border:1px solid rgba(79,70,229,.72);border-radius:4px;box-shadow:0 2px 8px rgba(49,65,88,.14);line-height:1.35}
.align-distance-line,.align-distance-tick{stroke:#6366f1;stroke-width:1;pointer-events:none}
.align-distance-line{stroke-dasharray:3 3}
.align-distance-bg{fill:#4f46e5;stroke:#fff;stroke-width:1;pointer-events:none}
.align-distance-text{fill:#fff;font-size:10px;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;font-weight:650;letter-spacing:0;pointer-events:none}
.edge-line{stroke:#000;stroke-width:2}
.line-preview-stroke{border-top-color:var(--line-color,#000)}
.line-preview-stroke:after{border-left-color:var(--line-color,#000)}
.connection-preview{stroke:#000}
.node-editor,.edge-editor{overflow-y:auto;padding-right:3px}
.format-row{margin-bottom:8px}
.underline-icon{text-decoration:underline;text-underline-offset:2px}
.font-color-palette{display:grid;grid-template-columns:repeat(10,1fr);gap:4px;margin:9px 0 10px;padding:7px;border:1px solid #e1e6ea;border-radius:5px;background:#f8fafb}
.font-color-palette button{aspect-ratio:1;background:var(--font-swatch);border:1px solid rgba(34,45,55,.18);border-radius:2px;min-width:0}
.font-color-palette button:hover,.font-color-palette button.active{box-shadow:0 0 0 2px #fff,0 0 0 3px #4f46e5}
.text-align-row{display:flex;gap:6px;margin-top:8px}
.align-button{font-size:18px;line-height:1;padding:0 7px}
.align-button.align-left{justify-content:flex-start}.align-button.align-center{justify-content:center}.align-button.align-right{justify-content:flex-end}
.node .node-body{stroke:#000;stroke-width:1.8}

/* Refined canvas strokes and compact Word-style text controls. */
.node .node-body{stroke:#74808a;stroke-width:1.15}
.node.selected .node-body{stroke:#4f46e5;stroke-width:1.65}
.edge-line{stroke:#66727c;stroke-width:1.35}
.edge-line.selected{stroke-width:2.15;filter:drop-shadow(0 0 2px rgba(79,70,229,.38))}
.connection-preview{stroke:#66727c;stroke-width:1.35}
.connection-preview.snapped{stroke-width:1.9}
.curve-handle{cursor:move;stroke-width:1.5}
.line-preview-stroke{border-top-color:var(--line-color,#66727c)}
.line-preview-stroke:after{border-left-color:var(--line-color,#66727c)}
.format-row{gap:5px;align-items:center}
.format-button{width:30px;height:30px;font-size:14px}
.align-button{display:flex;padding:0;align-items:center;justify-content:center;font-size:0}
.align-glyph{width:15px;display:flex;flex-direction:column;gap:2.5px}
.align-glyph i{display:block;width:15px;height:1px;background:currentColor;border-radius:1px}
.align-glyph i:nth-child(2){width:10px}
.align-left .align-glyph i{align-self:flex-start}
.align-center .align-glyph i{align-self:center}
.align-right .align-glyph i{align-self:flex-end}

/* 精致化：更小的调整基点 + 更浅的选中边框 */
.selection-outline{stroke:#c7d2fe;stroke-width:1;stroke-dasharray:4 4;opacity:.85}
.group-selection-outline{stroke:#c7d2fe;stroke-width:1.2;stroke-dasharray:5 4;opacity:.85}
.resize-handle{fill:#fff;stroke:#818cf8;stroke-width:1.2;filter:drop-shadow(0 1px 2px rgba(49,65,88,.16))}
.group-resize-handle{fill:#fff;stroke:#818cf8;stroke-width:1.3;filter:drop-shadow(0 1px 2px rgba(49,65,88,.16))}
.resize-handle:hover{stroke:#6366f1;stroke-width:1.6}

/* ===== 主题色变量：整体换色调时只需改这里 ===== */
:root{
  --accent:#4f46e5;            /* 主色（按钮、连线、px 标签描边与文字） */
  --accent-strong:#6366f1;     /* 主色-悬停高亮 */
  --accent-mid:#818cf8;        /* 中间色（基点描边） */
  --accent-soft:#c7d2fe;       /* 柔和色（单选边框） */
  --accent-soft-2:#c7d2fe;     /* 柔和色（组合边框） */
  --surface:#ffffff;           /* 标签/基点底色 */
  --ink:#30404b;               /* 正文墨色 */
  --shadow-soft:0 1px 2px rgba(49,65,88,.16);
}

/* px 距离标签：绿边框 + 白底 + 绿字 */
.align-distance-bg{fill:var(--surface);stroke:var(--accent);stroke-width:1.1;pointer-events:none}
.align-distance-text{fill:var(--accent);font-size:10px;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;font-weight:650;letter-spacing:0;pointer-events:none}
.align-distance-line,.align-distance-tick{stroke:var(--accent);stroke-width:1;pointer-events:none}

/* 基点与选中边框接入主题变量 */
.selection-outline{stroke:var(--accent-soft)}
.group-selection-outline{stroke:var(--accent-soft-2)}
.resize-handle{fill:var(--surface);stroke:var(--accent-mid);filter:drop-shadow(var(--shadow-soft))}
.group-resize-handle{fill:var(--surface);stroke:var(--accent-mid);filter:drop-shadow(var(--shadow-soft))}
.resize-handle:hover{stroke:var(--accent-strong)}

/* px 标签：文字在边框内完全居中，边框再浅一档 */
.align-distance-text{dominant-baseline:central}
.align-distance-bg{stroke:var(--accent-mid);stroke-opacity:.65}

/* 连线加粗：默认 1.35 → 2，选中 2.15 → 2.6 */
.edge-line{stroke-width:2}
.edge-line.selected{stroke-width:2.6}

/* ===== 属性面板改为悬浮覆盖层 =====
   原面板是 flex 兄弟节点，弹出时会把画布视口挤窄 254px，
   导致选中内容的瞬间画布重排、连线从光标下滑走，
   双击连线的第二次点击落空。改为绝对定位覆盖后画布布局恒定。 */
.workspace{position:relative}
.workspace .right-panel{position:absolute;top:0;right:0;bottom:0;z-index:30;box-shadow:-10px 0 28px rgba(49,65,88,.12)}

/* 连线标签默认字号（实际字号由内联 style 决定，这里保持一致便于查看） */
.edge-label{font-size:24px}

/* ===== 图形库预览：判断 / 输入补上与其他形状一致的边框 =====
   这两个预览用 clip-path 裁出菱形 / 平行四边形，CSS border 会连同
   形状一起被裁掉；负 z-index 伪元素又会被上层背景遮挡。
   因此直接用内联 SVG 作为背景图，描边与填充一体、不受裁剪影响。 */
.shape-preview.decision{
  border:0;
  background:#fff2d9 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 40' preserveAspectRatio='none'><polygon points='42,0.5 83.5,20 42,39.5 0.5,20' fill='%23fff2d9' stroke='%23d9b878' stroke-width='1'/></svg>") no-repeat;
  background-size:100% 100%;
}
.shape-preview.io{
  border:0;
  background:#f9e6ea url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 40' preserveAspectRatio='none'><polygon points='11.8,0.5 83.5,0.5 72.2,39.5 0.5,39.5' fill='%23f9e6ea' stroke='%23dfa8b6' stroke-width='1'/></svg>") no-repeat;
  background-size:100% 100%;
}
/* 悬停：边框变主绿，与其它形状 hover 的 border-color:#6366f1 统一 */
.shape-item:hover .shape-preview.decision{
  background:#ffefc9 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 40' preserveAspectRatio='none'><polygon points='42,0.5 83.5,20 42,39.5 0.5,20' fill='%23ffefc9' stroke='%232c9d92' stroke-width='1'/></svg>") no-repeat;
  background-size:100% 100%;
}
.shape-item:hover .shape-preview.io{
  background:#fbdde4 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 40' preserveAspectRatio='none'><polygon points='11.8,0.5 83.5,0.5 72.2,39.5 0.5,39.5' fill='%23fbdde4' stroke='%232c9d92' stroke-width='1'/></svg>") no-repeat;
  background-size:100% 100%;
}

/* ===== 拖回图形库即删除 =====
   拖拽模块时指针进入左侧图形库面板 → 面板高亮并提示，
   松手即删除该模块（与其相连的连线一并移除）。 */
.left-panel{position:relative}
.left-panel.drop-delete-active{background:#fff6f5;box-shadow:inset 0 0 0 2px rgba(224,104,95,.8)}
.left-panel.drop-delete-active::after{
  content:"松开鼠标删除模块";
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  padding:9px 16px;border-radius:8px;background:#e0685f;color:#fff;
  font-size:13px;font-weight:600;white-space:nowrap;letter-spacing:.2px;
  pointer-events:none;z-index:60;box-shadow:0 8px 20px rgba(224,104,95,.32);
}
/* 待删除的模块完全隐藏（避免在原位留下淡影/投影），只保留跟随鼠标的幽灵 */
.node.pending-remove{opacity:0;filter:none}
/* 拖入图形库时，原位置的选中框 / 基点也一并隐藏，画布上不留任何残影 */
body.palette-dropping .selection-outline,
body.palette-dropping .group-selection-outline,
body.palette-dropping .resize-handle,
body.palette-dropping .group-resize-handle{opacity:0}
/* 拖拽中的模块幽灵：fixed 浮层，可脱离画布裁剪随鼠标进入图形库，层级高于面板 */
.drag-ghost{
  position:fixed;left:0;top:0;pointer-events:none;z-index:200;
  opacity:.96;filter:drop-shadow(0 12px 20px rgba(49,65,88,.3));
}.drag-ghost svg{display:block}

/* 填充色板：每行 5 个（5×24 + 4×8 = 152px），浅色一行、深色一行 */
#colorRow{display:flex;flex-wrap:wrap;gap:8px;max-width:152px}

/* ===== 模块边框加深 + 悬浮效果增强 =====
   默认边框从 #74808a 加深到近黑的 #3f4b56，线宽 1.15 → 1.3；
   悬停时阴影更深更远、边框再加深加粗一档，并带平滑过渡。
   注意不能用 CSS transform 做上浮（会覆盖 SVG 的 translate 属性导致节点跳位）。 */
.node .node-body{stroke:#3f4b56;stroke-width:1.3}
.node.selected .node-body{stroke:#4f46e5;stroke-width:1.65}
.node{transition:filter .18s ease}
.node:hover{filter:drop-shadow(0 10px 16px rgba(49,65,88,.32)) drop-shadow(0 2px 3px rgba(49,65,88,.12))}
.node:hover .node-body{stroke:#2b353f;stroke-width:1.6}

/* ===== 属性面板避让 =====
   面板悬浮在画布右侧（254px，全高），会盖住靠近右边缘的模块，
   尤其是 东 / 东北 / 东南 三个基点被压住后完全拖不到。
   两层处理（逻辑见 app.js 的 avoidInspectorOverlap）：
   1) 选中变化时横向滚动画布「最小够用」的距离，把模块整体移出覆盖区；
   2) 拖拽 / 缩放 / 框选 / 平移期间面板淡出并让出指针事件，
      任何模块都能从面板下方经过，松手立刻恢复。 */
.workspace .right-panel{transition:opacity .16s ease}
body.manipulating .right-panel{opacity:.16;pointer-events:none}
/* 兜底：画布已经贴到最右、滚不动时，面板降级为「让位」态——
   半透明且可穿透，先把模块拖出来再恢复正常 */
.workspace .right-panel.inspector-yield{opacity:.42;pointer-events:none}


/* ===== 图形库分组折叠 ===== */
.left-panel{overflow-y:auto}
.palette-section+.palette-section{margin-top:16px}
.section-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;background:transparent;border:0;padding:0;cursor:pointer;font-family:inherit}
.section-toggle .section-caret{font-size:12px;color:#b3bdc5;transition:transform .18s}
.section-toggle.collapsed .section-caret{transform:rotate(-90deg)}
.shape-grid.collapsed{display:none}
/* 基础图形预览：无外框，横向略宽（64x44），
   框内统一以 52x32 内框绘制，各图形视觉大小一致 */
.shape-preview.glyph{width:64px;height:44px;border:0;background:transparent;padding:0}
.shape-preview.glyph svg{width:100%;height:100%;display:block;overflow:visible}
.shape-item:hover .shape-preview.glyph{box-shadow:none}
/* ===== 蚂蚁线流动动画（备用，当前未启用） =====
   已按需求取消蚂蚁线 / 蚂蚁虚线矩形的动态效果，此处仅保留动画定义，
   后续需要时给元素加回 class="ants" 即可复活。
   dasharray 写为 SVG 属性，动画只改偏移，导出图片时虚线仍在。 */
@keyframes fb-ants-march{to{stroke-dashoffset:-40}}
.ants{animation:fb-ants-march .9s linear infinite}

/* 基础图形不带名称：单个预览居中，去掉多余的下方留白 */
.shape-item.glyph-only{gap:0;justify-content:center;padding-bottom:2px}

/* 线类图形（直线/蚂蚁线/蚂蚁虚线矩形）的鲜艳色板：每行 4 个（4×24 + 3×8 = 120px） */
#nodeLineColorRow{display:flex;flex-wrap:wrap;gap:8px;max-width:120px}


/* ===== 模块状态标注（右键菜单）=====
   光晕环 + 流动虚线环都写在底层（本体之上），颜色 / 线宽 / 虚线写内联属性，
   动画走 CSS，因此导出图片时颜色与虚线仍在，只是不再流动。 */
@keyframes fb-status-march { to { stroke-dashoffset: -34; } }
@keyframes fb-status-pulse { 0%, 100% { opacity: .22; } 50% { opacity: .5; } }
@keyframes fb-status-breathe { 0%, 100% { opacity: .3; } 50% { opacity: .62; } }
.status-halo { animation: fb-status-pulse 2.2s ease-in-out infinite; }
.status-ring { animation: fb-status-march 1.5s linear infinite; }
/* 已完成：翠绿，缓慢向前流动 */
.status-done .status-ring { animation-duration: 2s; }
/* 正在进行：琥珀橙，流动最快 + 呼吸光晕 */
.status-doing .status-ring { animation-duration: .75s; }
.status-doing .status-halo { animation-name: fb-status-breathe; animation-duration: 1.5s; }
/* 重点：玫红，虚线反向流动 + 更强呼吸 */
.status-key .status-ring { animation-duration: 1s; animation-direction: reverse; }
.status-key .status-halo { animation-name: fb-status-breathe; animation-duration: 1.05s; }

/* ===== 右键菜单 ===== */
.node-menu {
  position: fixed; z-index: 70; min-width: 176px; padding: 6px;
  background: #fff; border: 1px solid #e2e8ee; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 32, 48, .18), 0 2px 6px rgba(16, 32, 48, .08);
}
.node-menu[hidden] { display: none; }
.node-menu-title { padding: 6px 8px 7px; color: #8494a2; font-size: 11px; letter-spacing: .3px; }
.node-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: 7px; color: #3c4a56; font-size: 13px; font-weight: 600; text-align: left;
}
.node-menu-item:hover { background: #eef2ff; color: #4f46e5; }
.node-menu-item.active { background: #eef2ff; box-shadow: inset 0 0 0 1px #e0e7ff; }
.node-menu-item i {
  width: 11px; height: 11px; border-radius: 50%; background: var(--dot, #c6d0d8);
  box-shadow: 0 0 8px var(--dot, transparent), 0 0 2px var(--dot, transparent);
}
.node-menu-item i.plain { background: #c6d0d8; box-shadow: none; }
.node-menu-sep { height: 1px; margin: 5px 4px; background: #eef1f4; }

/* ===== 符号图形库：小贴纸，一行 4 个 ===== */
.shape-grid.symbol-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 6px}
.shape-preview.sym{width:32px;height:32px;border:0;background:transparent;padding:0;margin:0 auto}
.shape-preview.sym svg{width:100%;height:100%;display:block;overflow:visible}
.shape-item:hover .shape-preview.sym{box-shadow:none;transform:translateY(-1px) scale(1.14)}

/* ===== 图形库面板收起 / 展开 =====
   收起：flex-basis 归零、内边距与边框一并收起，画布立刻变宽；
   展开：恢复到 CSS 里定义的 254px（小屏 210 / 180px）宽度。 */
.left-panel{transition:flex-basis .22s ease,width .22s ease,padding .22s ease,opacity .16s ease}
.left-panel.collapsed{flex:0 0 0;width:0;min-width:0;padding-left:0;padding-right:0;border-right:0;overflow:hidden;opacity:0;pointer-events:none}
/* 收起后画布左边缘的展开把手：
   做成醒目的竖条按钮；鼠标靠到画布最左边（不限高度）时淡淡发光提示 */
.palette-handle{position:absolute;left:0;top:50%;transform:translateY(-50%);z-index:40;
  width:27px;height:96px;padding:0;border:1px solid #cfd9e0;border-left:0;
  border-radius:0 13px 13px 0;background:linear-gradient(180deg,#ffffff,#eef2ff);
  color:#5c6a75;font-size:21px;line-height:1;font-weight:600;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  box-shadow:2px 0 10px rgba(49,65,88,.12);
  transition:color .18s,background .18s,box-shadow .22s,width .18s,border-color .18s}
.palette-handle:hover,
body.palette-near .palette-handle{width:31px;color:#4338ca;border-color:#a5b4fc;
  background:linear-gradient(180deg,#eef2ff,#e0e7ff);
  box-shadow:0 0 14px rgba(79,70,229,.42),0 0 30px rgba(79,70,229,.24),2px 0 10px rgba(49,65,88,.12)}
.palette-handle:active{background:linear-gradient(180deg,#e0e7ff,#c7d2fe)}
.palette-handle[hidden]{display:none}

/* ===== 图形库标题与下方分组的间距 =====
   搜索框删除后标题与「基础图形」贴得太近，这里补回呼吸感 */
.left-panel .panel-heading{margin-bottom:24px}

/* ===== 大括号的 +／− 分支按钮 =====
   常显在模块下方；未选中时收敛一些，悬停 / 选中时清晰可见 */
.brace-btn{cursor:pointer;opacity:.55;transition:opacity .15s}
.node:hover .brace-btn,.node.selected .brace-btn{opacity:1}
.brace-btn .brace-btn-bg{fill:#fff;stroke:#c3ccd4;stroke-width:1.2;transition:fill .15s,stroke .15s}
.brace-btn .brace-btn-glyph{fill:#69747e;font-size:14px;font-weight:700;pointer-events:none;user-select:none}
.brace-btn:hover .brace-btn-bg{fill:#eefaf7;stroke:#4f46e5}
.brace-btn:hover .brace-btn-glyph{fill:#4f46e5}
.brace-btn.dim .brace-btn-bg{stroke-dasharray:2.5 2.5}

/* ===== 撤销 / 重做 / 截图：Office 风格图标按钮 ===== */
.icon-btn svg{width:18px;height:18px;display:block;fill:currentColor}
.shot-split{position:relative;display:flex;align-items:center}
.shot-split .shot-caret{width:15px;font-size:10px;color:#98a3ad}
.shot-split .shot-caret .caret-glyph{line-height:1;font-size:10px}
.shot-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:70;min-width:246px;padding:6px;
  border:1px solid #dfe6ec;border-radius:10px;background:#fff;box-shadow:0 14px 30px rgba(31,45,61,.18)}
.shot-menu[hidden]{display:none}
.shot-item{display:flex;align-items:center;gap:7px;width:100%;padding:8px 9px;border:0;border-radius:7px;
  background:transparent;cursor:pointer;font-family:inherit;text-align:left}
.shot-item:hover{background:#eef2ff}
.shot-item .shot-tick{width:12px;flex:0 0 12px;color:var(--teal);font-size:12px;font-weight:700}
.shot-item .shot-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.shot-item .shot-text b{font-size:12px;color:#33414d;font-weight:650}
.shot-item .shot-text em{font-style:normal;font-size:10px;color:#95a0aa}
.shot-item kbd{font-family:inherit;font-size:9px;color:#8d9aa5;background:#f4f7f9;border:1px solid #e4eaef;
  border-radius:4px;padding:2px 5px;white-space:nowrap}
/* ===== 缩放比例：数字可点选后直接打字修改 ===== */
.zoom-box{display:flex;align-items:center}
.zoom-value{width:40px;height:26px;border:1px solid transparent;border-radius:6px;background:transparent;
  font-family:inherit;font-size:12px;color:#65717d;text-align:center;padding:0;outline:none}
.zoom-value:hover{border-color:#dfe6ec}
.zoom-value:focus{border-color:var(--teal);background:#fff;color:#17212b;box-shadow:0 0 0 2px rgba(79,70,229,.13)}
.zoom-pct{font-size:12px;color:#98a3ad;margin-left:1px}

/* ===== 截图框选浮层（微信风格）===== */
.shot-stage{position:fixed;inset:0;z-index:9000;cursor:crosshair;user-select:none;-webkit-user-select:none}
.shot-stage[hidden]{display:none}
.shot-dim{position:absolute;inset:0;background:rgba(13,20,26,.46);pointer-events:none}
.shot-dim[hidden]{display:none}
.shot-hole{position:absolute;overflow:hidden;pointer-events:none;border:1px solid rgba(255,255,255,.9);
  box-shadow:0 0 0 200vmax rgba(13,20,26,.46), 0 0 0 2px rgba(9,190,175,.55), 0 6px 24px rgba(0,0,0,.28)}
.shot-hole[hidden]{display:none}
.shot-hole-img{position:absolute;background-repeat:no-repeat;background-size:100% 100%;background-color:#fbfcfd}
.shot-handles{position:absolute;inset:0;pointer-events:none}
.shot-handles[hidden]{display:none}
.shot-hd{position:absolute;width:9px;height:9px;margin:-5px 0 0 -5px;border-radius:2px;background:#fff;
  border:1.5px solid #09beaf;box-shadow:0 1px 3px rgba(0,0,0,.4);pointer-events:auto}
.shot-hd[data-hd="nw"],.shot-hd[data-hd="se"]{cursor:nwse-resize}
.shot-hd[data-hd="ne"],.shot-hd[data-hd="sw"]{cursor:nesw-resize}
.shot-hd[data-hd="n"],.shot-hd[data-hd="s"]{cursor:ns-resize}
.shot-hd[data-hd="e"],.shot-hd[data-hd="w"]{cursor:ew-resize}
.shot-size{position:absolute;padding:3px 7px;border-radius:4px;background:rgba(18,26,32,.84);color:#fff;
  font-size:11px;letter-spacing:.02em;white-space:nowrap;pointer-events:none}
.shot-size[hidden]{display:none}
.shot-bar{position:absolute;display:flex;align-items:center;gap:4px;padding:4px;border-radius:9px;
  background:rgba(20,28,34,.93);box-shadow:0 10px 26px rgba(0,0,0,.4)}
.shot-bar[hidden]{display:none}
.shot-act{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#e9eff3;
  font-size:14px;line-height:1;display:grid;place-items:center;cursor:pointer;font-family:inherit}
.shot-act:hover{background:rgba(255,255,255,.16)}
.shot-act.shot-done{background:#09beaf;color:#032420}
.shot-act.shot-done:hover{background:#12d3c2}
.shot-tip{position:absolute;left:50%;top:14px;transform:translateX(-50%);padding:6px 13px;border-radius:999px;
  background:rgba(18,26,32,.84);color:#eef4f7;font-size:12px;white-space:nowrap;pointer-events:none}

/* ===== 顶栏课程信息栏（课程主题 / 日期 / 上课时间）===== */
.class-bar{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.class-label{font-size:13px;font-weight:600;color:#53616d;flex:0 0 auto}
.class-input{height:34px;border:1px solid #cbd4dc;border-radius:6px;background:#fff;padding:0 12px;font-size:14px;font-weight:600;color:var(--ink);width:220px;outline:none}
.class-input:focus{border-color:#6366f1;box-shadow:0 0 0 2px rgba(99,102,241,.12)}
.class-select{height:34px;border:1px solid #cbd4dc;border-radius:6px;background:#fff;padding:0 8px;font-size:13px;font-weight:600;color:var(--ink);outline:none;cursor:pointer;max-width:220px}
.class-select:focus{border-color:#6366f1}
.class-select-time{width:112px}

.class-week{height:34px;display:inline-flex;align-items:center;padding:0 14px;border:1px solid #cbd4dc;border-radius:6px;background:#fff;font-size:13px;font-weight:600;color:var(--ink);flex:0 0 auto}

/* 日期框：原生 date input 透明覆盖，外观显示年月日文本，点击弹日历 */
.date-wrap{position:relative;height:34px;border:1px solid #cbd4dc;border-radius:6px;background:#fff;flex:0 0 auto;cursor:pointer;display:flex}
.date-wrap:hover{border-color:#a5b4fc}
.class-date-text{display:flex;align-items:center;height:100%;padding:0 12px;font-size:13px;font-weight:600;color:var(--ink);white-space:nowrap}
.date-caret{display:flex;align-items:center;padding:0 8px 0 0;color:#8b96a1;font-size:10px}
/* 自定义日历弹层 */
.calendar-pop{position:fixed;z-index:1200;background:#fff;border:1px solid #d5dce3;border-radius:10px;box-shadow:0 12px 32px rgba(20,40,60,.18);padding:12px;width:252px;user-select:none}
.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.cal-title{font-size:13px;font-weight:600;color:#7b8894;letter-spacing:.5px}
.cal-title b{font-size:19px;font-weight:800;color:var(--ink);margin-left:3px}
.cal-nav{width:26px;height:26px;border-radius:6px;color:#7b8894;font-size:15px;display:grid;place-items:center;cursor:pointer}
.cal-nav:hover{background:#eef2ff;color:var(--teal)}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center}
.cal-dow{font-size:11px;color:#9aa5ae;padding:4px 0}
.cal-day{height:30px;line-height:30px;border-radius:6px;font-size:13px;cursor:pointer;color:var(--ink)}
.cal-day:hover{background:#eef2ff}
.cal-day.empty{visibility:hidden}
.cal-day.today{box-shadow:inset 0 0 0 1.5px #6366f1;font-weight:700;color:var(--teal)}
.cal-day.selected{background:#6366f1;color:#fff;font-weight:700}
.cal-day.selected.today{color:#fff}

/* 老师姓名框（预留，后期账号自动带入） */
.class-input-teacher{width:120px}
/* 课程重点：比课程名称（220px）长一些，一句话能写完 */
.class-input-point{width:320px}

/* 功能介绍逐句分行 */
.tip-lines div{margin:3px 0;white-space:nowrap}

/* 线类图形旋转手柄：Word 风格双向弧形箭头（PNG 光标 + SVG 图标），悬停/拖动均为旋转光标 */
.rotate-handle{cursor:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAWUlEQVR42mNgGAWjYBSQALj6m/7jwwNqOc0cQYwlNHUIKYZS3QHkGEg1R1BiEFVDglwHjJYZo4Cq5cCAJMJBkQ0HtCAaFEXxoKiMBrw6HjQNklEwCkbBsAUAWu3JwcvD1PsAAAAASUVORK5CYII=") 16 16, auto;filter:drop-shadow(0 1px 2px rgba(49,65,88,.2))}
.rotate-handle path{fill:none;stroke:#6366f1;stroke-width:1.7;stroke-linecap:round}
.rotate-handle polygon{fill:#6366f1}
body.manipulating .rotate-handle{cursor:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAWUlEQVR42mNgGAWjYBSQALj6m/7jwwNqOc0cQYwlNHUIKYZS3QHkGEg1R1BiEFVDglwHjJYZo4Cq5cCAJMJBkQ0HtCAaFEXxoKiMBrw6HjQNklEwCkbBsAUAWu3JwcvD1PsAAAAASUVORK5CYII=") 16 16, auto}


/* ===== UI 焕新 · 靛蓝主题质感层 ===== */
/* 顶栏：轻渐变 + 悬浮投影 */
.topbar{background:linear-gradient(180deg,#ffffff,#fafaff);box-shadow:0 1px 0 var(--line),0 3px 16px rgba(49,46,129,.06);z-index:35;position:relative}
/* 顶栏输入控件：更圆润的边框 + 聚焦光环 */
.class-input,.class-select,.date-wrap,.class-week{border-radius:9px;border-color:#dfe3ee;background:#fff}
.class-input:hover,.class-select:hover,.date-wrap:hover{border-color:#c7d2fe}
.class-input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.14)}
.class-select:focus,.date-wrap:focus-within{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.14)}
.class-label{color:#64748b;letter-spacing:.2px}
/* 工具按钮：圆角 + 更利落的悬停 */
.icon-btn,.ghost-btn{border-radius:8px;transition:background .15s,color .15s}
/* 返回主页：左上角明确带文字的按钮（上课时好找） */
.back-home-btn{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 13px;border:1px solid #dfe3ee;border-radius:9px;background:#fff;font-size:13px;font-weight:600;color:#64748b;cursor:pointer;transition:border-color .15s,color .15s}
.back-home-btn:hover{border-color:#a5b4fc;color:#4f46e5}
.back-home-btn svg{width:15px;height:15px;fill:currentColor;flex:0 0 auto}
@media(max-width:1000px){.back-home-text{display:none}.back-home-btn{padding:0 9px}}
/* 左侧面板：微冷调底色 + 分组标题更精神 */
.left-panel{background:#fcfcff}
.section-label{letter-spacing:.6px;text-transform:uppercase}
.section-label span:first-child{position:relative;padding-left:9px}
.section-label span:first-child::before{content:"";position:absolute;left:0;top:50%;transform:translateY(-50%);width:3px;height:11px;border-radius:2px;background:#c7d2fe}
.section-toggle:not(.collapsed) span:first-child::before{background:#6366f1}
/* 图形库预览卡片：圆角 + 柔和悬停 */
.shape-preview{border-radius:7px}
.shape-item{border-radius:8px;padding:4px 2px;transition:background .15s;touch-action:none}
.shape-item:hover{background:#f4f5ff}
/* 触摸拖拽兜底的跟随幽灵（HTML5 拖放在触摸屏上不触发，走指针事件模拟） */
.touch-drag-ghost{position:fixed;z-index:9999;pointer-events:none;transform:translate(-50%,-50%);background:#3f4b56;color:#fff;font-size:13px;line-height:1;padding:7px 12px;border-radius:99px;box-shadow:0 4px 12px rgba(40,50,60,.35);white-space:nowrap}
/* 属性面板控件：统一圆角 */
.font-selects select,.field input,.format-button,.line-style-toggle button,.delete-btn{border-radius:7px}
.format-button{transition:border-color .15s,background .15s,color .15s}
.type-chip{border-radius:6px}
/* 画布区：底色带一点靛蓝冷调 */
.canvas-viewport{background:#f7f8fc}
.board{background:#fbfbfe}
/* 面板/弹层滚动条 */
.left-panel::-webkit-scrollbar,.right-panel::-webkit-scrollbar,.node-editor::-webkit-scrollbar,.edge-editor::-webkit-scrollbar{width:8px}
.left-panel::-webkit-scrollbar-thumb,.right-panel::-webkit-scrollbar-thumb,.node-editor::-webkit-scrollbar-thumb,.edge-editor::-webkit-scrollbar-thumb{background:#dfe3ee;border-radius:8px}
.left-panel::-webkit-scrollbar-thumb:hover,.right-panel::-webkit-scrollbar-thumb:hover,.node-editor::-webkit-scrollbar-thumb:hover,.edge-editor::-webkit-scrollbar-thumb:hover{background:#c7d2fe}
/* 右键菜单 / 截图菜单 / 日历：更圆润统一 */
.node-menu,.shot-menu,.calendar-pop{border-radius:12px}
.node-menu-item{border-radius:8px}
.shot-item{border-radius:8px}
/* Toast：胶囊形 + 深墨色 */
.toast{background:#1e1b4b;color:#eef2ff;border-radius:999px;padding:10px 18px;font-size:12.5px;box-shadow:0 10px 28px rgba(30,27,75,.35)}
/* 空状态提示：靛蓝点缀 */
.empty-icon{border-color:#c7d2fe;color:#818cf8;background:#f4f5ff}
/* 状态点：翡翠绿（语义色保留，更鲜亮） */
.status-dot{box-shadow:0 0 0 3px rgba(16,185,129,.16)}
/* 展开把手 */
.palette-handle{border-radius:0 13px 13px 0}
/* 选中预览块 */
.selected-preview{border-radius:8px}
/* 顶栏保存状态不换行 */
.saved-state{white-space:nowrap;flex:0 0 auto}

/* ===== 学员点名按钮 + 弹窗 ===== */
/* 学员点名：与「返回主页 / 新建白板 / 打开白板」同一套 tab-btn 外观（描边光钩子保留） */
.rollcall-btn svg{width:15px;height:15px;fill:none;stroke:currentColor;flex:0 0 auto}
.rollcall-btn circle{fill:currentColor;stroke:none}
.rollcall-overlay{position:fixed;inset:0;background:rgba(30,27,75,.42);z-index:200;display:grid;place-items:center}
.rollcall-panel{width:480px;max-width:92vw;max-height:82vh;overflow-y:auto;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(30,27,75,.3);padding:22px 24px}
.rollcall-panel h3{font-size:16.5px;font-weight:800;display:flex;align-items:center;justify-content:space-between}
.rollcall-close{border:0;background:#f4f5ff;color:#64748b;width:26px;height:26px;border-radius:8px;cursor:pointer;font-size:14px}
.rollcall-close:hover{background:#e0e7ff;color:#4f46e5}
.rollcall-sub{font-size:12px;color:#94a3b8;margin:4px 0 14px}
.rollcall-lesson{border:1.5px solid #e0e7ff;border-radius:12px;padding:10px 14px;margin-bottom:10px;cursor:pointer;transition:border-color .15s,background .15s}
.rollcall-lesson:hover{border-color:#a5b4fc;background:#fafaff}
.rollcall-lesson.active{border-color:#4f46e5;background:#eef2ff}
.rollcall-lesson .t{font-size:14.5px;font-weight:700;display:flex;justify-content:space-between;align-items:center}
.rollcall-lesson .m{font-size:12px;color:#94a3b8;margin-top:3px}
.rollcall-lesson .done-tag{font-size:11px;font-weight:700;padding:2px 9px;border-radius:999px;background:#d1fae5;color:#047857}
.rollcall-lesson .done-tag.settle{background:#ccfbf1;color:#0f766e;border:1px solid #99f6e4}
.rollcall-stus{margin-top:6px;border-top:1px dashed #e0e7ff;padding-top:10px}
.rollcall-stus .stu{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#334155;background:#f8f9ff;border:1px solid #eef0fa;border-radius:9px;padding:6px 11px;margin:0 8px 8px 0;cursor:pointer;user-select:none}
.rollcall-stus .stu:hover{border-color:#c7d2fe}
.rollcall-stus .stu input{accent-color:#4f46e5;width:14px;height:14px;cursor:pointer}
.rollcall-stus .stu .tag{font-size:10.5px;font-weight:800;padding:1px 6px;border-radius:999px;background:#eef2f7;color:#64748b}
/* 已确认到课（含课表端「学员消课」确认过的）：青绿实底，与课表已消课配色一致 */
.rollcall-stus .stu.done{background:#0f766e;border-color:#0f766e;color:#fff}
.rollcall-stus .stu.done .tag{background:rgba(255,255,255,.24);color:#fff}
.rollcall-foot{display:flex;gap:10px;margin-top:14px}
.rollcall-confirm{flex:1;height:40px;border:0;border-radius:10px;background:linear-gradient(135deg,#4f46e5,#6d5bf0);color:#fff;font-size:14px;font-weight:700;cursor:pointer;box-shadow:0 6px 16px rgba(79,70,229,.28)}
.rollcall-confirm:hover{filter:brightness(1.06)}
.rollcall-confirm:disabled{opacity:.6;cursor:default}
.rollcall-empty{text-align:center;color:#94a3b8;font-size:13px;padding:26px 0}
/* 当天课表为空时：列出最近有课的日期，点一下直接切过去 */
.rollcall-jump{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;margin-top:12px;font-size:12px;color:#94a3b8}
.rollcall-jump button{border:1px solid #d9dcf5;background:#fff;color:#4f46e5;border-radius:9px;padding:5px 10px;font-size:12.5px;font-weight:700;cursor:pointer}
.rollcall-jump button:hover{border-color:#a5b4fc;background:#f5f6ff}

/* 点名弹窗：请假学员置灰不可勾选 */
/* 请假学员：样式与课表里的请假学员一致（灰底虚线、不可勾选、不扣课时） */
.rollcall-stus .stu.leave{filter:grayscale(1);opacity:.6;color:#94a3b8;background:#f1f5f9;border:1px dashed #cbd5e1;text-decoration:line-through}
.rollcall-stus .stu.leave input{accent-color:#cbd5e1}
.rollcall-stus .stu.leave .tag{background:#e2e8f0;color:#94a3b8}

/* ===== 点名弹窗：只显示本节课，学员方块排列与「课表管理」格子里完全一致 ===== */
/* 本节课信息条：日期 · 上课时间 · 主题 · 授课老师 · 点名状态 */
.rollcall-scope{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:13px;font-weight:700;color:#334155;background:#f5f7ff;border:1px solid #e6e9fb;border-radius:10px;padding:8px 12px;margin-bottom:10px}
.rollcall-scope .done-tag{font-size:11px;font-weight:800;padding:2px 9px;border-radius:999px;background:#d1fae5;color:#047857}
.rollcall-scope .done-tag.settle{background:#ccfbf1;color:#0f766e;border:1px solid #99f6e4}
.rollcall-scope .done-tag.wait{background:#fef3c7;color:#b45309}
/* 学员方块网格：与课表格子的 .cell-grid 同一套排布（自动铺排，一格一个学员） */
.rc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;align-content:start;border-top:1px dashed #e0e7ff;padding-top:12px}
.rc-chip{position:relative;display:flex;align-items:center;justify-content:center;gap:4px;height:40px;padding:0 9px;border-radius:9px;border:1px solid transparent;font-size:13.5px;font-weight:700;color:#111827;cursor:pointer;user-select:none;white-space:nowrap;overflow:hidden;box-shadow:0 1px 3px rgba(15,23,42,.1);transition:transform .12s,box-shadow .12s,background .12s}
.rc-chip:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(15,23,42,.2)}
.rc-chip input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.rc-chip .rc-nm{overflow:hidden;text-overflow:ellipsis}
/* 与课表一致：男浅蓝 / 女浅粉 / 未填灰 / 体验课学员淡紫 */
.rc-chip.m{background:#e3f1ff;border-color:#a9d6ff}
.rc-chip.f{background:#fff4f9;border-color:#fbd9e9}
.rc-chip.g{background:#f1f5f9;border-color:#dfe5ec}
.rc-chip.t{background:#eef2ff;border-color:#c7d2fe}
.rc-chip .tag{font-size:10.5px;font-weight:800;line-height:1.7;padding:0 6px;border-radius:999px;background:#eef2f7;color:#64748b;flex:0 0 auto}
/* 选中到课：青绿实底 + ✓（与课表「已消课」同一配色） */
.rc-chip.on{background:#0f766e;border-color:#0f766e;color:#fff}
.rc-chip.on::after{content:"✓";font-weight:900;margin-left:2px}
.rc-chip.on .tag{background:rgba(255,255,255,.24);color:#fff}
/* 请假：灰底虚线、划线、不可选、不扣课时（与课表里的请假学员一致） */
.rc-chip.leave{filter:grayscale(1);opacity:.62;background:#f1f5f9;border:1px dashed #cbd5e1;color:#94a3b8;text-decoration:line-through;cursor:not-allowed}
.rc-chip.leave .tag{background:#e2e8f0;color:#94a3b8}
/* 已选人数 + 全选 / 清空 */
.rollcall-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;font-size:12.5px;color:#64748b}
.rollcall-tools .rc-count b{color:#4f46e5}
.rc-quick{display:inline-flex;gap:6px}
.rc-quick button{border:1px solid #d9dcf5;background:#fff;color:#4f46e5;border-radius:9px;padding:4px 11px;font-size:12.5px;font-weight:700;cursor:pointer}
.rc-quick button:hover{border-color:#a5b4fc;background:#f5f6ff}
.rc-quick[hidden]{display:none}

/* ===== 课程体系联动：把板书存进课程 / 打开其他老师的板书（只读） ===== */
/* 保存到本地 / 保存到课程体系：与「新建白板 / 打开白板」同一套 tab-btn 外观（HTML 直接用 .tab-btn） */
/* 板书已绑定课程体系时高亮提示（app.js refreshSaveBtn 会切 .bound） */
.tab-btn.bound{background:#e6fffb;box-shadow:inset 0 0 0 1px #99f6e4;color:#0f766e}
.tab-btn[hidden]{display:none!important}
.board-ro-bar{display:flex;align-items:center;gap:10px;padding:8px 16px;background:#fff7ed;border-bottom:1px solid #fed7aa;color:#9a3412;font-size:13px;font-weight:600}
.board-ro-bar[hidden]{display:none}
.board-ro-ico{font-size:13px}
.board-ro-bar .ghost-btn{margin-left:auto;flex:0 0 auto;white-space:nowrap;width:auto;display:inline-flex;align-items:center;gap:6px;border:1px solid #fdba74;background:#fff;color:#c2410c;height:28px;padding:0 12px;font-size:12.5px;font-weight:700;cursor:pointer;border-radius:8px;font-family:inherit}
.board-ro-bar .ghost-btn:hover{background:#ffedd5}
/* 只读板书：藏起所有编辑入口（图形库 / 属性面板 / 点名 / 保存 / 撤销重做） */
body.board-readonly .left-panel,
body.board-readonly .palette-handle,
body.board-readonly .right-panel,
body.board-readonly #rollcallBtn,
body.board-readonly #quickSave,
body.board-readonly #undoBtn,
body.board-readonly #redoBtn{display:none!important}
body.board-readonly .left-tip{display:none!important}
/* 保存到课程体系 弹窗 */
.cs-modal{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:400}
.cs-modal[hidden]{display:none}
.cs-box{width:450px;max-width:calc(100vw - 40px);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border-radius:16px;padding:20px 22px;box-shadow:0 24px 60px rgba(15,23,42,.3)}
.cs-title{font-size:16px;font-weight:800;color:var(--ink)}
.cs-tip{font-size:12.5px;color:var(--muted);line-height:1.7;margin:6px 0 10px}
.cs-label{display:block;font-size:12.5px;font-weight:700;color:#475569;margin:12px 0 5px}
.cs-select,.cs-input{width:100%;height:38px;border:1px solid #cbd4dc;border-radius:9px;background:#fff;padding:0 11px;font-size:13.5px;color:var(--ink);outline:none;font-family:inherit;box-sizing:border-box}
.cs-select:focus,.cs-input:focus{border-color:#14b8a6}
.cs-btns{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.cs-btns .primary-btn{background:#4f46e5;border:0;color:#fff;height:34px;padding:0 18px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit}
.cs-btns .primary-btn:hover{background:#4338ca}
.cs-btns .ghost-btn{width:auto;height:34px;padding:0 16px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
/* 保存到课程体系：课程阶段 / 单元 / 课程名称 三级联动 + 就地新建 */
.cs-label-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0 5px}
.cs-label-row .cs-label{margin:0}
.cs-mini{border:0;background:none;color:#4f46e5;font-size:12.5px;font-weight:700;cursor:pointer;padding:0;font-family:inherit}
.cs-mini:hover{text-decoration:underline}
.cs-mini[hidden]{display:none!important}
.cs-newrow{display:flex;gap:8px;margin-top:6px}
.cs-newrow[hidden]{display:none!important}
.cs-newrow .cs-input{flex:1 1 auto;min-width:0}
.cs-newrow .ghost-btn{flex:0 0 auto;width:auto;white-space:nowrap;height:38px;padding:0 14px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:9px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.cs-newrow .ghost-btn:hover{background:#f8fafc}
/* ===== 保存到本地 / 选择文件夹 ===== */
.dir-modal{z-index:500}
.ls-pathrow{display:flex;gap:8px;align-items:center}
.ls-pathrow .cs-input{flex:1 1 auto;min-width:0;background:#f8fafc;color:#475569}
.ls-pathrow .ghost-btn{flex:0 0 auto;width:auto;white-space:nowrap;height:38px;padding:0 14px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:9px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.ls-pathrow .ghost-btn:hover{border-color:#a5b4fc;color:#4338ca}
.ls-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ls-quick .ls-chip{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #e8edf3;background:#fbfcfe;color:#475569;border-radius:999px;padding:4px 11px;font-size:11.5px;font-weight:700;cursor:pointer;font-family:inherit}
.ls-quick .ls-chip:hover{border-color:#a5b4fc;color:#4338ca;background:#f5f7ff}
.ls-namerow{display:flex;gap:8px;align-items:center}
.ls-namerow .cs-input{flex:1 1 auto;min-width:0}
.ls-namerow .ls-ext{flex:0 0 auto;font-size:12.5px;font-weight:700;color:#94a3b8}
.ls-fullpath{margin:10px 0 0;font-size:12px;line-height:1.6;color:#475569;background:#f8fafc;border:1px dashed #dbe3ec;border-radius:9px;padding:8px 10px;word-break:break-all}
.ls-fullpath.warn{color:#b45309;border-color:#fcd34d;background:#fffbeb}
/* 选择文件夹弹窗：面包屑 + 文件夹列表 + 底部当前路径 */
.dir-box{width:560px;max-width:calc(100vw - 40px);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(15,23,42,.3)}
.dir-head{display:flex;align-items:flex-start;gap:10px;padding:18px 20px 14px;border-bottom:1px solid #f1f5f9}
.dir-head-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.dir-head-t{font-size:15.5px;font-weight:800;color:var(--ink)}
.dir-head-s{font-size:12px;color:var(--muted)}
.dir-x{flex:0 0 auto;width:30px;height:30px;border:0;border-radius:8px;background:none;color:#94a3b8;font-size:18px;line-height:1;cursor:pointer;font-family:inherit}
.dir-x:hover{background:#f1f5f9;color:#334155}
.dir-navrow{display:flex;align-items:center;gap:8px;padding:14px 20px 0}
.dir-navrow-edit{padding-top:8px}
.dir-navrow-edit[hidden]{display:none!important}
.dir-navrow-edit .cs-input{flex:1 1 auto;min-width:0;font-size:12.5px}
.dir-up{flex:0 0 auto;width:36px;height:36px;border:1px solid var(--line);background:#fff;border-radius:9px;color:#475569;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}
.dir-up svg{width:18px;height:18px;fill:currentColor}
.dir-up:hover:not(:disabled){border-color:#a5b4fc;color:#4338ca;background:#f5f7ff}
.dir-up:disabled{opacity:.35;cursor:default}
.dir-crumb{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:1px;overflow-x:auto;scrollbar-width:thin;background:#f8fafc;border:1px solid #e8edf3;border-radius:9px;padding:5px 8px;white-space:nowrap}
.dir-crumb::-webkit-scrollbar{height:5px}
.dir-seg{flex:0 0 auto;max-width:170px;overflow:hidden;text-overflow:ellipsis;border:0;background:none;font-family:inherit;font-size:12.5px;font-weight:600;color:#475569;padding:3px 6px;border-radius:6px;cursor:pointer;line-height:1.4}
.dir-seg:hover{background:#e4e9f5;color:#4338ca}
.dir-seg.on{background:#e4e9ff;color:#4338ca;font-weight:800}
.dir-sep{flex:0 0 auto;color:#b6c0cd;font-size:11px;padding:0 1px}
.dir-editpath,.dir-go{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;border:0;background:none;color:#94a3b8;font-family:inherit;font-size:11.5px;font-weight:700;cursor:pointer;padding:6px 8px;border-radius:7px;white-space:nowrap}
.dir-editpath svg{width:13px;height:13px;fill:currentColor}
.dir-editpath:hover{background:#f1f5f9;color:#475569}
.dir-go{height:38px;padding:0 14px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:9px;font-size:13px;font-weight:600}
.dir-go:hover{border-color:#a5b4fc;color:#4338ca}
.dir-quick{display:flex;flex-wrap:wrap;gap:6px;padding:10px 20px 0}
.dir-quick .dir-chip{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #e8edf3;background:#fbfcfe;color:#475569;border-radius:999px;padding:5px 12px;font-size:11.5px;font-weight:700;cursor:pointer;font-family:inherit}
.dir-quick .dir-chip:hover{border-color:#a5b4fc;color:#4338ca;background:#f5f7ff}
.dir-list{margin:12px 20px 0;height:240px;overflow:auto;border:1px solid #eef2f7;border-radius:12px;padding:8px;background:#fbfcfe}
.dir-list::-webkit-scrollbar{width:6px}
.dir-row{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:none;font-family:inherit;font-size:13px;color:#334155;padding:7px 10px;border-radius:9px;cursor:pointer;line-height:1.4}
.dir-row:hover{background:#eef2ff}
.dir-row .dir-ico{flex:0 0 auto;width:30px;height:30px;border-radius:8px;background:#e0e7ff;display:inline-flex;align-items:center;justify-content:center;font-size:14px}
.dir-row .dir-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.dir-row .dir-go{flex:0 0 auto;font-size:11px;font-weight:800;color:#4f46e5;opacity:0;transition:opacity .12s}
.dir-row:hover .dir-go{opacity:1}
.dir-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:100%;min-height:120px;font-size:12px;color:#a8b3c2;line-height:1.7;text-align:center}
.dir-empty .dir-empty-ico{font-size:26px;opacity:.55;line-height:1}
.dir-foot{display:flex;align-items:center;gap:10px;padding:14px 20px 18px}
.dir-cur{flex:1 1 auto;min-width:0;font-size:11.5px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dir-foot-btns{display:flex;gap:10px}
.dir-foot-btns .primary-btn{background:#4f46e5;border:0;color:#fff;height:34px;padding:0 18px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit}
.dir-foot-btns .primary-btn:hover{background:#4338ca}
.dir-foot-btns .ghost-btn{width:auto;height:34px;padding:0 16px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
/* ===== 多白板标签栏（像浏览器那样同时开好几块白板）===== */
.board-tabs{display:flex;align-items:flex-end;gap:6px;padding:6px 12px 0;background:#f4f6fb;border-bottom:1px solid var(--line);position:relative;z-index:34}
.board-tabs[hidden]{display:none}
.board-tabs-list{display:flex;align-items:flex-end;gap:4px;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.board-tabs-list::-webkit-scrollbar{height:6px}
.board-tabs-list::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}
.board-tab{display:flex;align-items:center;gap:6px;max-width:220px;min-width:96px;height:30px;padding:0 8px 0 12px;background:#e8edf6;border:1px solid var(--line);border-bottom:0;border-radius:9px 9px 0 0;font-size:12.5px;color:#475569;cursor:pointer;user-select:none;flex:0 0 auto}
.board-tab:hover{background:#eef2f9}
.board-tab.active{background:#fff;color:var(--ink);font-weight:700;box-shadow:0 -2px 6px rgba(49,46,129,.08)}
.board-tab.ro{color:#9a3412}
.board-tab .bt-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.board-tab .bt-lock{flex:0 0 auto;font-size:11px}
.board-tab .bt-dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:#f59e0b}
.board-tab .bt-dot.new{background:#94a3b8}
.board-tab .bt-close{flex:0 0 auto;width:16px;height:16px;line-height:15px;text-align:center;border:0;border-radius:50%;background:transparent;color:#94a3b8;font-size:14px;cursor:pointer;padding:0;font-family:inherit}
.board-tab .bt-close:hover{background:#e2e8f0;color:#0f172a}
.board-tabs-hint{flex:0 0 auto;margin-bottom:8px;font-size:11.5px;color:#9aa7b6;white-space:nowrap}
@media (max-width:1180px){.board-tabs-hint{display:none}}

/* ===== 课表联动：到点改时间 / 上课待点名 —— 只在外围描边光，按键本身不变 ===== */
@keyframes fbDueRing{
  0%,100%{box-shadow:0 0 0 1.5px rgba(248,113,113,.70),0 0 6px 1px rgba(248,113,113,.24)}
  50%{box-shadow:0 0 0 2.5px rgba(239,68,68,.95),0 0 13px 3px rgba(239,68,68,.42)}
}
.class-select-time.time-due{border-color:#f87171!important;animation:fbDueRing 1.7s ease-in-out infinite}
.rollcall-btn.rollcall-due{border-color:#f87171!important;animation:fbDueRing 1.7s ease-in-out infinite}
.rollcall-btn.rollcall-due:hover{background:#f5f7ff}
/* 确认课程时间弹窗（保存白板 / 生成课堂笔记前，课程已结束时提示） */
.ct-preview{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;color:#0f766e;background:#f0fdfa;border:1px solid #99f6e4;border-radius:10px;padding:10px 12px;margin-top:6px}
.ct-preview .ct-wk{font-size:12px;font-weight:600;color:#0d9488}

/* ===== 顶栏拆两行 =====
   第一行（.topbar-main）：返回主页 + 新建白板 + 打开白板 + 快速保存 / 保存到课程体系 + 自动保存状态
   第二行（.topbar-class）：白板分页标签（占满一行）+ 上课信息（日期/时间/主题/老师）+ 点名、撤销重做、截图、缩放
   这样「已自动保存」不再挤在右端盖住撤销按钮，分页标签也单独一行不会挤压上课信息。 */
.topbar-main{height:auto;min-height:50px;padding:8px 16px;gap:8px;align-items:center;background:#f4f6fb;border-bottom:1px solid var(--line);box-shadow:none;flex-wrap:wrap;row-gap:8px;z-index:36}
.topbar-main .saved-state{margin-left:auto;flex:0 0 auto}
.topbar-sep{flex:0 0 auto;width:1px;height:22px;background:#dfe3ee;margin:0 2px}
/* 第一行里的「新建白板 / 打开白板」按钮：跟返回主页同一套外观 */
.tab-btn{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 13px;border:1px solid #dfe3ee;border-radius:9px;background:#fff;font-size:13px;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;transition:border-color .15s,color .15s;white-space:nowrap}
.tab-btn:hover{border-color:#a5b4fc;color:#4f46e5}
.tab-btn:active{background:#f5f7ff}
.tab-btn svg{width:15px;height:15px;fill:currentColor;flex:0 0 auto}
.tab-btn .ob-caret{font-size:10px;color:#94a3b8;line-height:1}
.tab-btn[hidden]{display:none!important}

/* ===== 打开白板：层级筛选下拉（课程阶段 → 单元 → 课程 → 板书）===== */
.ob-wrap{position:relative;flex:0 0 auto}
.ob-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:430;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 46px rgba(15,23,42,.2);padding:10px 12px 8px;width:min(720px,calc(100vw - 40px))}
.ob-menu[hidden]{display:none}
.ob-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12.5px;font-weight:800;color:#334155;padding:0 2px 8px}
/* 打开白板：课程体系 / 本地白板 两种来源切换 */
.ob-modes{display:inline-flex;gap:3px;background:#f1f5f9;border-radius:9px;padding:3px;margin-left:auto}
.ob-mode{border:0;background:transparent;font-family:inherit;font-size:12px;font-weight:700;color:#64748b;padding:4px 11px;border-radius:7px;cursor:pointer}
.ob-mode:hover{color:#4338ca}
.ob-mode.on{background:#fff;color:#4338ca;box-shadow:0 1px 3px rgba(49,46,129,.14)}
.ob-close{border:0;background:none;font-size:17px;line-height:1;color:#94a3b8;cursor:pointer;padding:0 2px;font-family:inherit}
.ob-close:hover{color:#0f172a}
.ob-body{display:flex;gap:8px;align-items:flex-start}
/* hidden 属性会被 .ob-body 的 display:flex 压掉，这里显式压回去 */
.ob-body[hidden]{display:none!important}
.ob-body-local{display:block;max-height:320px;overflow:auto;padding-right:2px}
.ob-local-list{display:block}
.ob-board.cur{border-color:#a5b4fc;background:#f8faff}
.ob-col{flex:1 1 0;min-width:0;max-height:320px;overflow:auto;padding-right:8px;border-right:1px solid #eef2f7}
.ob-col:last-child{border-right:0;padding-right:0}
.ob-col.ob-col-boards{flex:1.6 1 0}
.ob-col-head{font-size:11px;font-weight:800;color:#94a3b8;letter-spacing:.02em;padding:0 6px 5px;position:sticky;top:0;background:#fff}
.ob-item{display:block;width:100%;text-align:left;border:0;background:none;font-family:inherit;font-size:13px;color:#334155;padding:7px 8px;border-radius:8px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35}
.ob-item:hover{background:#f1f5f9}
.ob-item.on{background:#eef2ff;color:#4338ca;font-weight:700}
.ob-empty{font-size:12px;color:#a8b3c2;padding:6px 8px;line-height:1.7}
.ob-board{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:1px solid #eef2f7;background:#fff;border-radius:9px;padding:7px 9px;margin-bottom:6px;cursor:pointer;font-family:inherit}
.ob-board:hover{border-color:#a5b4fc;background:#f8faff}
.ob-board .ob-bd-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.ob-board .ob-bd-name{font-size:12.5px;font-weight:700;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ob-board .ob-bd-sub{font-size:11px;color:#94a3b8;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ob-board .ob-bd-go{flex:0 0 auto;font-size:11.5px;font-weight:700;color:#4f46e5}
.ob-foot{font-size:11.5px;color:#94a3b8;padding:8px 2px 0;border-top:1px solid #eef2f7;margin-top:8px;line-height:1.6}
/* 本地白板：不再罗列文件——点「本地白板」直接弹系统文件选择框，这里只留占位说明 */

.topbar-class{height:auto;min-height:56px;padding:6px 20px 8px;gap:6px 12px;align-items:center;background:#fff;border-bottom:1px solid var(--line);box-shadow:none;flex-wrap:wrap}
/* 第二行：分页标签占满一行（浏览器式页签：底边一条线，当前标签压线），上课信息与工具在下面一行 */
.topbar-class .board-tabs{flex:1 1 100%;min-width:0;align-items:flex-end;padding:0;background:transparent;border-bottom:1px solid var(--line);z-index:auto;gap:6px}
.topbar-class .board-tabs-list{align-items:flex-end;gap:4px}
.topbar-class .board-tabs-hint{margin-bottom:6px}
.topbar-class .class-bar{flex:1 1 0;min-width:0;gap:8px;flex-wrap:wrap;row-gap:6px}
.topbar-class .class-bar>*{flex:0 0 auto}
.topbar-class .top-actions{flex:0 0 auto;margin-left:auto}
@media(max-width:860px){.topbar-main .saved-state{display:none}}
/* 导出给家长 弹窗 */
.ex-box{width:640px}
.ex-stage{position:relative;margin-top:14px;background:#f1f5f9;border:1px solid var(--line);border-radius:12px;max-height:46vh;overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:12px}
.ex-canvas{display:block;width:330px;height:auto;border-radius:10px;box-shadow:0 8px 22px rgba(15,23,42,.18);background:#fff}
.ex-canvas[hidden]{display:none!important}
.ex-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.78);border-radius:12px;font-size:12.5px;color:var(--muted)}
.ex-loading[hidden]{display:none!important}
.ex-row{display:flex;gap:12px}
.ex-row .ex-col{flex:1 1 0;min-width:0}
.ex-row .ex-col-date{flex:0 0 172px}
.ex-row .ex-col-time{flex:0 0 132px}
.ex-bgrow{display:flex;gap:10px;align-items:center}
.ex-bgrow .cs-select{flex:1 1 auto;min-width:0}
.ex-bgrow .ghost-btn{width:auto;height:38px;padding:0 16px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:9px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap}
.ex-bgrow .ghost-btn:disabled{opacity:.5;cursor:default}
/* ===== 浏览器快捷键 / 鼠标手势冲突提示 ===== */
.icon-btn{position:relative}
.icon-btn.has-conf::after{content:"";position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:#ef4444;box-shadow:0 0 0 2px #fff}
.sc-box{width:560px}
.sc-list{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.sc-item{display:flex;gap:10px;align-items:flex-start;border:1px solid #e6ebf0;border-radius:10px;padding:10px 12px;background:#fbfcfd}
.sc-item.bad{border-color:#fbd9a8;background:#fffaf1}
.sc-ico{flex:0 0 20px;height:20px;border-radius:50%;background:#fde8c8;color:#b45309;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}
.sc-item.ok .sc-ico{background:#dcf3e7;color:#0a7f56}
.sc-item h4{margin:0 0 3px;font-size:13px;color:var(--ink)}
.sc-item p{margin:0;font-size:12.5px;color:#475569;line-height:1.65}
.sc-fix{border-top:1px solid #edf1f4;padding-top:12px}
.sc-fix-head{font-size:13px;font-weight:700;color:var(--ink)}
.sc-steps{margin:6px 0 0;padding-left:19px;font-size:12.5px;color:#475569;line-height:1.85}
.sc-addr{display:flex;align-items:center;gap:8px;margin-top:11px;background:#f1f5f9;border-radius:9px;padding:7px 10px}
.sc-addr-label{font-size:12px;font-weight:700;color:#64748b;white-space:nowrap}
.sc-addr code{flex:1 1 auto;min-width:0;font-size:12.5px;color:#0f766e;font-family:ui-monospace,Consolas,monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-addr .ghost-btn{width:auto;height:26px;padding:0 12px;border:1px solid var(--line);background:#fff;color:#475569;border-radius:7px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit}

/* ===== 手机自适应：图形库更窄、顶栏更紧凑（html[data-device] 由 index.html 头部脚本标注）===== */
@media(max-width:560px){
  .left-panel{width:172px;flex-basis:172px;padding-left:10px;padding-right:10px}
  .shape-preview{width:60px}
  .topbar-main{padding:6px 10px;gap:6px}
  .topbar-class{padding:5px 10px 7px}
  .topbar-main .ghost-btn{height:32px;padding:0 10px;font-size:12.5px}
}
