/* ported from pages/hb/canvas.wxss */
.edit-container{display:flex;flex-direction:column;height:calc(100vh - var(--tab-h))}
.canvas-area{
  display:flex;align-items:center;justify-content:center;
  background:rgba(96,111,248,.1);box-sizing:border-box;flex:1;
  padding:56px 6px calc(var(--tab-h) + 74px);
}
.top-toolbar{
  display:flex;flex-direction:row;justify-content:space-between;
  padding:8px 4px;top:0;background:#fff;left:50%;transform:translateX(-50%);
  position:fixed;right:0;z-index:100;width:100%;max-width:520px;
}
.bottom-toolbar{
  background:#fff;left:50%;transform:translateX(-50%);position:fixed;right:0;z-index:100;
  bottom:var(--tab-h);padding:6px 0;width:100%;max-width:520px;
}
.bottom-toolbar .toolbar-content{display:flex;justify-content:space-between}
.toolbar-scroll{white-space:nowrap}
.tool-item,.tool-item-t{display:flex;flex-direction:column;align-items:center;justify-content:center;width:20%;cursor:pointer}
.tool-item-t{background:#fff;padding-bottom:1px;border:none;font:inherit;color:inherit}
.tool-item-t:active{background:#f5f5f5}
.top-tool-name{color:#4e4d4d;font-size:11px;text-align:center}
.tool-divider{background:#ddd;height:40px;margin:0 10px;width:1px}

.edit-canvas{background:#fff;border-radius:2px;height:100%;max-height:70vh;overflow:hidden;position:relative;width:100%}
.element-wrapper{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}
.canvas-element{display:flex;align-items:center;justify-content:center;cursor:move;position:absolute;z-index:10;pointer-events:auto}
.canvas-element.selected{z-index:20}
.element-text{box-sizing:border-box;line-height:1.4;padding:4px;text-align:center;word-break:break-all;max-width:100%}
.element-text-input{box-sizing:border-box;line-height:1.4;padding:4px;text-align:center;word-break:break-all;
  background:transparent;border:1px dashed #368eff;border-radius:4px;outline:none;width:100%;height:100%}
.element-image{border-radius:4px;height:100%;width:100%;pointer-events:none}
.element-shape{background:transparent;border:2px solid;border-radius:4px;height:100%;width:100%}
.selection-box{position:absolute;left:-4px;right:-4px;top:-4px;bottom:-4px;min-height:100%;pointer-events:none;z-index:30}
/* the selection box must not block dragging, but its handles must stay hitable */
.corner{position:absolute;z-index:30;background:#368eff;border:2px solid #fff;border-radius:50%;height:12px;width:12px;pointer-events:auto}
.corner.top-left{left:-6px;top:-6px}
.corner.top-right{right:-6px;top:-6px}
.corner.bottom-left{bottom:-6px;left:-6px}
.corner.bottom-right{bottom:-6px;right:-6px}
.edge{position:absolute;z-index:25;background:#368eff;pointer-events:auto}
.edge.top{height:2px;left:10px;right:10px;top:0}
.edge.bottom{height:2px;left:10px;right:10px;bottom:0}
.edge.left{width:2px;top:10px;bottom:10px;left:0}
.edge.right{width:2px;top:10px;bottom:10px;right:0}
.rotate-handle{position:absolute;left:50%;top:calc(100% + 10px);margin-left:-18px;width:22px;height:22px;
  border-radius:50%;background:linear-gradient(135deg,#368eff,#69b1ff);border:1px solid #fff;pointer-events:auto;
  cursor:pointer;z-index:100;display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 12px rgba(0,0,0,.25);transition:transform .15s ease,box-shadow .15s ease}
.rotate-handle:active{box-shadow:0 2px 6px rgba(54,142,255,.4);transform:scale(.95)}
.rotate-icon{color:#fff;font-size:15px;font-weight:700;line-height:1}

/* the pill that floats above a selected element */
.action-buttons{position:absolute;z-index:100;display:flex;gap:10px;padding:3px 10px;background:#fff;
  border:1px solid #ebe6e6;border-radius:30px;transform:translateX(-50%);pointer-events:auto}
.action-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;
  border:1px solid #fff;cursor:pointer}
.btn-img{height:20px;width:20px;pointer-events:none}

.tool-icon,.tool-icon-t{border-radius:3px;height:20px;width:20px}
.top-tool-icon{height:20px;margin:auto;width:20px}
.top-tool-icon,.tool-icon,.tool-icon-t{display:block;object-fit:contain}
.top-img{display:flex;align-items:center;justify-content:center;padding-bottom:4px}
.tool-name,.tool-name-t{color:#aaa6a6;font-size:11px;line-height:18px}
.name-active{color:#f7570c}

/* --- 画布下方的内联素材条 --- */
.fixed-bottom{position:fixed;left:50%;transform:translateX(-50%);right:0;bottom:calc(var(--tab-h) + 54px);
  width:100%;max-width:520px;background:#fff;padding:10px 90px 5px 16px;z-index:99;box-sizing:border-box}
.fixed-bottom .scroll-view{background:#fff;white-space:nowrap;overflow-x:auto;width:100%}
.bor-item{display:inline-block;margin-right:12px;cursor:pointer}
.img-css{height:40px;width:auto;display:block}
.more-img{color:#797a79;font-size:12px;padding:12px;text-align:center;cursor:pointer}
.more-img-btn{position:fixed;right:calc(50% - 260px);bottom:calc(var(--tab-h) + 63px);display:flex;
  flex-direction:row;background:#f5f5f5;z-index:100;cursor:pointer}
@media (max-width:520px){.more-img-btn{right:0}}
.img-up{padding-left:8px;width:30px;display:flex;align-items:center;justify-content:center}
.up-css{height:20px;margin-top:9px;width:20px}

/* --- 模板元素弹层 --- */
.more-modal-mask{position:fixed;top:50px;bottom:0;left:50%;transform:translateX(-50%);right:0;z-index:1000;
  width:100%;max-width:520px;background:rgba(0,0,0,.5);display:flex}
.more-modal{position:relative;background:#fff;width:100%;border-top-left-radius:20px;border-top-right-radius:20px;
  padding:12px;overflow:hidden}
.more-close{position:absolute;right:15px;top:12px;cursor:pointer}
.more-close-img{height:18px;width:18px;padding:5px}
.more-name{color:#413f3f;font-size:18px;font-weight:700;text-align:center}
.more-fixed{padding-top:10px}
.more-serch{height:40px;width:100%;margin-top:25px;margin-bottom:12px}
/* scoped so it cannot leak into the 模板 page search bar, which shares these class names */
.more-modal .top-search{display:flex;flex-direction:row;width:100%;height:34px;margin:0}
.more-modal .top-search-item{display:flex;flex-direction:row;width:100%;background:#f5f5f5;border:1px solid #ebeae9;
  border-radius:20px;height:38px;align-items:center;padding-left:0}
.more-modal .top-search-item-img{padding-left:8px;display:flex;align-items:center}
.more-modal .item-img{height:16px;width:16px}
.more-modal .top-search-item-text{color:#575555;font-size:12px;height:35px;padding-left:6px;width:90%;
  background:transparent;border:none;outline:none}
.more-tab{background:#f5f5f5;display:flex;flex-direction:row;justify-content:space-between}
.more-item{color:#747474;font-size:14px;padding:12px;text-align:center;width:40%;cursor:pointer}
.more-active{color:#606ff8}
.more-list-content{height:calc(100vh - 200px);padding-bottom:60px;overflow-y:auto}
.more-list{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;margin-top:20px;
  padding-bottom:40px}
.more-img-list{border:1px solid #ddd;border-radius:3px;margin-bottom:10px;width:31%;cursor:pointer}
.img-list-css{height:80px;width:100%;display:block;object-fit:contain;background:#fff}
.img-name{color:#363636;font-size:12px;padding:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.img-bt{display:flex;flex-direction:row;font-size:12px;justify-content:space-between}
.img-bt-item{color:#525151;flex:1;overflow:hidden;padding:6px 0 6px 6px;text-overflow:ellipsis;white-space:nowrap}
.img-bt-sc{flex-shrink:0;height:18px;margin-left:auto;padding:6px;width:18px;cursor:pointer}
.img-sc{height:18px;width:18px;display:block}
.tip-name{background:#f5f5f5;font-size:12px;margin:12px;padding:10px}

/* --- 画布尺寸弹层 --- */
.ratio-modal-mask{position:fixed;top:0;bottom:0;left:50%;transform:translateX(-50%);right:0;z-index:1000;
  width:100%;max-width:520px;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center}
.ratio-modal{background:#fff;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.2);overflow:hidden;width:80%;
  position:relative;max-height:82vh;overflow-y:auto}
.modal-close{color:#999;cursor:pointer;font-size:24px;height:30px;width:30px;margin-left:70%;padding:10px;position:absolute}
.modal-close:active{color:#666}
.modal-header{border-bottom:1px solid #eee;padding-top:12px;text-align:center}
.modal-title{color:#333;font-size:16px;font-weight:700;text-align:center;margin-bottom:0}
.ratio-options{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:10px}
.ratio-option{display:flex;align-items:center;justify-content:space-between;background:#f8f9fa;border-radius:10px;
  cursor:pointer;margin-bottom:10px;padding:12px;transition:all .2s ease;width:40%;box-sizing:border-box}
.ratio-option.active{background:#e6f7ff;border:2px solid #368eff}
.ratio-option:active{transform:scale(.98)}
.ratio-label{color:#333;font-size:14px;font-weight:400}
.ratio-size{color:#999;font-size:14px}
.custom-section{border-top:1px solid #eee;padding:15px}
.section-title{color:#666;font-size:14px;font-weight:500;margin-bottom:15px}
.custom-inputs{display:flex;gap:15px;margin-bottom:15px}
.input-item{flex:1}
.input-item.full{width:100%}
.ratio-input{border:1px solid #ddd;border-radius:8px;box-sizing:border-box;font-size:16px;height:40px;
  padding:0 10px;width:100%}
.ratio-input:focus{border-color:#368eff;outline:none}
.custom-btn{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#368eff,#69b1ff);
  border-radius:8px;color:#fff;cursor:pointer;font-size:16px;font-weight:500;height:45px;width:100%;
  transition:all .2s ease}
.custom-btn:active{opacity:.9;transform:scale(.98)}

/* --- AI文案 --- */
.ai-tip-row{display:flex;gap:8px;flex-wrap:wrap;padding:12px 4px 0}
.ai-tip{background:#f0f0fb;color:#606ff8;border-radius:14px;font-size:12px;padding:6px 12px;cursor:pointer}
.ai-item{background:#f8f9fa;border-radius:10px;padding:12px;margin-bottom:10px;font-size:13px;color:#3f3e3e;
  line-height:1.6}
.ai-item .ai-copy{color:#606ff8;font-size:12px;margin-top:8px;display:inline-block;cursor:pointer}

.export-grid{display:flex;flex-direction:column;gap:10px}
.export-item{display:flex;align-items:center;gap:12px;background:#f6f6fd;border-radius:10px;padding:10px;cursor:pointer}
.export-item img{width:110px;height:78px;object-fit:contain;background:#fff;border-radius:5px;border:1px solid #eee;flex:none}
.export-name{font-size:15px;color:#3f3e3e}
.export-desc{color:#a3a1a1;font-size:12px;padding-top:4px}
.export-go{margin-left:auto;background:#606ff8;color:#fff;border-radius:20px;padding:8px 14px;font-size:13px;white-space:nowrap}

/* --- 画布内 AI 素材（素材弹层里的一行） --- */
.ai-ele-row{display:flex;align-items:center;gap:8px;margin:0 0 10px}
.ai-ele-input{flex:1;height:34px;border:1px solid #e3e3ef;border-radius:18px;background:#f6f6fd;padding:0 12px;
  font-size:13px;color:#3f3e3e;outline:none;min-width:0}
.ai-ele-btn{flex:none;background:#3f9a56;color:#fff;border-radius:18px;padding:8px 14px;font-size:13px;cursor:pointer}
.ai-ele-btn.busy{background:#a9c9b2;cursor:default}

/* --- 自动成稿的排版产物 --- */
.element-text .text-line{white-space:pre-wrap}
.element-shape.shape-fill{border:none;border-radius:0}
.element-shape.shape-banner{border:none;border-radius:14px}

/* --- AI 一键成稿弹层 --- */
.auto-modal,.lint-modal{max-height:82vh;overflow-y:auto}
.auto-field{margin-top:14px}
.auto-label{color:#797a79;font-size:12px;margin-bottom:6px}
.auto-input{width:100%;height:38px;border:1px solid #e3e3ef;border-radius:8px;padding:0 12px;font-size:15px;
  color:#3f3e3e;outline:none;box-sizing:border-box}
.auto-grid{display:flex;gap:14px}
.auto-grid .auto-field{flex:1;min-width:0}
.auto-opts{display:flex;flex-wrap:wrap;gap:6px}
.auto-chip{border:1px solid #e3e3ef;border-radius:16px;padding:6px 11px;font-size:13px;color:#555454;cursor:pointer;
  background:#fff}
.auto-chip.on{background:#606ff8;border-color:#606ff8;color:#fff}
.auto-actions{display:flex;align-items:center;gap:10px;margin-top:18px;flex-wrap:wrap}
.auto-btn{background:#f0f0f6;color:#3f3e3e;border-radius:20px;padding:10px 16px;font-size:14px;cursor:pointer}
.auto-btn.primary{background:#606ff8;color:#fff}
.auto-btn.busy{opacity:.6;cursor:default}
.auto-note{color:#a3a1a1;font-size:12px;flex:1;min-width:120px}

/* --- 手抄报体检 --- */
.lint-score{display:flex;align-items:baseline;gap:10px;margin-top:14px}
.lint-num{font-size:38px;font-weight:700;color:#606ff8;line-height:1}
.lint-word{color:#555454;font-size:14px}
.lint-list{margin-top:12px;display:flex;flex-direction:column;gap:8px}
.lint-item{display:flex;align-items:flex-start;gap:8px;background:#f6f6fd;border-radius:8px;padding:9px 11px;
  font-size:13px;color:#3f3e3e;line-height:1.5}
.lint-item.error{background:#fdf0ef}
.lint-tag{flex:none;font-size:11px;border-radius:10px;padding:2px 8px;background:#606ff8;color:#fff;margin-top:2px}
.lint-item.error .lint-tag{background:#d93025}
.lint-msg{flex:1;min-width:0;word-break:break-word}
.lint-fixable{flex:none;color:#3f9a56;font-size:11px;margin-top:3px}
