:root{
  --bg:#f7f7f8;--text:#1f2329;--muted:#7a8191;--line:#eceef3;--soft:#f7f8fb;
  --card:#fff;--black:#050505;--accent:#7d6bff;--accent2:#fff0bd;
  --shadow:0 22px 70px rgba(20,25,40,.09);--radius:24px;
}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif}button,textarea,input{font:inherit}button{cursor:pointer}a{text-decoration:none;color:inherit}
.top-nav{height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 42px;background:rgba(247,247,248,.88);backdrop-filter:blur(16px);position:sticky;top:0;z-index:50}
.nav-left,.brand,.nav-links{display:flex;align-items:center}.brand{gap:10px;margin-right:48px}.brand strong{font-size:20px}.brand-mark{width:35px;height:35px;position:relative;display:inline-block}.planet{position:absolute;inset:6px;border:2px solid #111;border-radius:50%;background:#fff}.planet:after{content:"";position:absolute;left:-9px;top:11px;width:42px;height:9px;border-top:2px solid #111;transform:rotate(-22deg);border-radius:50%}
.nav-links{gap:38px;font-size:16px}.nav-links a{color:#25272d}.nav-links a.active{font-weight:500}.avatar-btn{width:40px;height:40px;border:0;background:transparent;position:relative}.avatar-btn span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#d8c0a8}.avatar-btn i{position:absolute;right:3px;bottom:5px;width:12px;height:12px;border-radius:50%;background:#9b7cff;border:2px solid #fff}
.page{max-width:1220px;margin:0 auto;padding:54px 20px 70px}.hero{text-align:center;margin-bottom:58px}.hero h1{font-size:68px;letter-spacing:-3px;line-height:1;margin:0 0 24px;font-weight:800}.hero p{font-size:16px;color:#626b7d;margin:0 auto 22px;max-width:800px}.hero-tags{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.hero-tags span{border:1px solid #f0d47e;background:#fffdf5;color:#a36d00;border-radius:999px;padding:9px 18px;font-size:14px}
.composer-card{background:rgba(255,255,255,.96);border-radius:26px;box-shadow:var(--shadow);padding:20px 20px 76px;position:relative;margin-top:-10px;border:1px solid rgba(235,237,242,.8)}.composer-inner{display:grid;grid-template-columns:150px 1fr;gap:18px;min-height:178px}.upload-column{display:flex;align-items:center;gap:12px}.mini-upload{width:92px;height:132px;border:1px dashed #e4e5ea;border-radius:18px;background:#fbfbfc;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#8b92a3;transition:.18s;flex-shrink:0}.mini-upload:hover,.mini-upload.dragover{border-color:#c7bbff;background:#faf8ff}.plus{width:34px;height:34px;border-radius:50%;background:#f0f1f5;color:#9aa0ad;display:grid;place-items:center;font-size:25px;margin-bottom:11px}.upload-main{font-size:13px;color:#7c8393}.upload-sub{font-size:12px;margin-top:4px}.preview-list{display:flex;gap:8px;flex-wrap:wrap;max-height:138px;overflow:auto}.preview-item{width:58px;height:58px;border-radius:14px;overflow:hidden;position:relative;background:#f1f2f5;border:1px solid #e9ebf1}.preview-item img{width:100%;height:100%;object-fit:cover;display:block}.preview-item button{position:absolute;right:3px;top:3px;border:0;width:18px;height:18px;line-height:16px;border-radius:50%;background:rgba(0,0,0,.58);color:#fff;padding:0}
.prompt-column{position:relative;border-left:1px solid transparent}.prompt-head{display:flex;align-items:center;justify-content:space-between;color:#9aa0ad;font-size:16px;padding:8px 0 4px}.history-btn{border:0;background:transparent;color:#687188;font-weight:600;padding:8px 6px;border-radius:10px}.history-btn:hover{background:#f5f6f8}textarea#prompt{width:100%;height:122px;resize:none;border:0;outline:none;background:transparent;font-size:16px;line-height:1.7;color:#20242d;padding:4px 0 0}.prompt-count{text-align:right;color:#afb4c0;font-size:13px}.negative-hidden{display:none}
.composer-toolbar{position:absolute;left:20px;bottom:20px;right:190px;height:42px;display:flex;align-items:center;gap:12px}.model-pill,.setting-pill,.random-btn{height:42px;border-radius:999px;border:1px solid #e8eaf1;background:#fff;box-shadow:0 5px 18px rgba(20,25,40,.04);display:flex;align-items:center;gap:9px;padding:0 15px;color:#313640}.model-pill em{font-style:normal;background:#f3f3f5;border:1px solid #e7e8ed;border-radius:999px;font-size:12px;padding:2px 7px;color:#6f7584}.swirl{font-size:17px;color:#596170}.setting-pill strong{font-weight:500;min-width:20px;text-align:center}.setting-pill span{color:#6b7280}.random-btn{margin-left:auto;background:#080808;color:#fff;border-color:#080808;font-weight:700;padding:0 23px;position:absolute;right:-170px}.floating-generate{position:absolute;right:20px;bottom:20px;height:42px;min-width:132px;border:0;border-radius:16px;background:#050505;color:#fff;font-weight:800;display:none;align-items:center;justify-content:center;gap:8px;box-shadow:0 12px 26px rgba(0,0,0,.12)}.composer-card.has-text .floating-generate{display:flex}.composer-card.has-text .random-btn{display:none}.btn-loading{display:none}.floating-generate.loading .btn-text{display:none}.floating-generate.loading .btn-loading{display:inline}.spark{font-size:15px}
.result-card{margin-top:28px;background:#fff;border:1px solid #eef0f4;border-radius:26px;box-shadow:var(--shadow);padding:22px;min-height:360px}.result-top{display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid #f0f1f4;padding-bottom:18px}.result-top h2{margin:0 0 6px;font-size:20px}.result-top p{margin:0;color:#7f8798;font-size:14px}.clear-btn{border:1px solid #e8eaf0;background:#fff;border-radius:999px;padding:8px 14px;color:#687083}.state{min-height:250px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#687083}.empty-icon{width:54px;height:54px;border-radius:18px;background:#f7f8fb;display:grid;place-items:center;font-size:24px;margin-bottom:12px}.state h3{margin:0 0 8px;color:#1f2530}.state p{margin:0}.hidden{display:none!important}.spinner{width:54px;height:54px;border-radius:50%;border:5px solid #eee9ff;border-top-color:#6f60ff;animation:spin 1s linear infinite;margin-bottom:18px}@keyframes spin{to{transform:rotate(360deg)}}
.result-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px;padding-top:22px}.result-item{position:relative;border-radius:18px;overflow:hidden;background:#f2f3f6;border:1px solid #eceef3;min-height:220px}.result-item img{width:100%;height:100%;display:block;object-fit:cover}.result-actions{position:absolute;right:10px;bottom:10px;display:flex;gap:8px;opacity:0;transform:translateY(8px);transition:.18s}.result-item:hover .result-actions{opacity:1;transform:translateY(0)}.result-actions a,.result-actions button{border:0;background:rgba(0,0,0,.76);color:#fff;border-radius:999px;padding:8px 12px;font-size:13px}
.settings-popover{position:fixed;left:50%;top:174px;transform:translateX(-50%);z-index:100}.settings-card{width:384px;background:rgba(255,255,255,.96);backdrop-filter:blur(20px);border:1px solid #eceef4;border-radius:16px;box-shadow:0 26px 80px rgba(0,0,0,.14);padding:16px}.section-title{font-size:14px;color:#434a57;margin-bottom:18px}.ratio-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px 18px}.ratio-grid button{height:52px;border:0;background:transparent;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:#626a79}.ratio-grid button.active{background:#f1f1f2;box-shadow:inset 0 0 0 1px #e2e3e7}.r{display:block;border:1.5px solid #b9bdc7;border-radius:4px;background:#f7f8fa}.r11{width:20px;height:20px}.r43{width:22px;height:16px}.r32{width:23px;height:15px}.r169{width:24px;height:13px}.r219{width:25px;height:11px}.r34{width:16px;height:22px}.r23{width:15px;height:24px}.r45{width:16px;height:22px}.r916{width:13px;height:24px}.r54{width:22px;height:17px}.r.auto{width:20px;height:20px;display:grid;place-items:center;font-style:normal;font-size:12px}
.line{height:1px;background:#eef0f4;margin:18px 0}.settings-row{display:flex;align-items:center;justify-content:space-between;margin:12px 0;color:#4a5160;font-size:14px}.seg{height:32px;padding:3px;background:#f1f2f4;border:1px solid #e7e8ed;border-radius:999px;display:flex}.seg button{border:0;background:transparent;border-radius:999px;min-width:38px;padding:0 12px;color:#737b8a}.seg button.active{background:#fff;color:#20242d;box-shadow:0 2px 8px rgba(0,0,0,.08)}.seg.wide button{min-width:46px;padding:0 8px}.toggle input{display:none}.toggle i{display:block;width:38px;height:22px;border-radius:999px;background:#111;position:relative}.toggle i:after{content:"";position:absolute;width:18px;height:18px;right:2px;top:2px;background:#fff;border-radius:50%;transition:.18s}.toggle input:not(:checked)+i{background:#d8dbe2}.toggle input:not(:checked)+i:after{right:18px}
.modal{position:fixed;inset:0;z-index:120}.modal-mask{position:absolute;inset:0;background:rgba(0,0,0,.75)}.history-panel{position:absolute;left:50%;top:0;transform:translateX(-50%);width:min(88vw,1120px);height:100vh;background:#fff;border-radius:10px 10px 0 0;margin-top:0;padding:64px 64px 40px;overflow:auto}.modal-close{position:absolute;right:24px;top:20px;border:0;background:transparent;font-size:30px;color:#777}.history-panel h2{text-align:center;margin:0 0 16px;font-size:26px}.history-panel>p{text-align:center;color:#708096;margin:0 0 42px}.history-list{border:1px solid #eceef3;border-radius:24px;min-height:360px;padding:28px}.history-item{border-bottom:1px solid #f0f1f4;padding:18px 0}.history-item:last-child{border-bottom:0}.history-item small{display:block;color:#8b93a3;margin-bottom:8px}.history-item p{margin:0 0 12px;line-height:1.6}.history-images{display:flex;gap:12px;flex-wrap:wrap}.history-images img{width:150px;height:150px;object-fit:cover;border-radius:16px;background:#f1f2f5}.restore-btn{float:right;border:0;background:#050505;color:#fff;border-radius:999px;padding:8px 14px}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:140;display:grid;place-items:center;padding:44px}.lightbox img{max-width:96vw;max-height:92vh;border-radius:18px}.lightbox-close{position:absolute;right:26px;top:22px;border:0;background:rgba(255,255,255,.12);color:#fff;width:42px;height:42px;border-radius:50%;font-size:24px}
@media(max-width:760px){.top-nav{padding:0 18px}.nav-links{display:none}.page{padding:30px 12px}.hero h1{font-size:46px}.composer-inner{grid-template-columns:1fr}.upload-column{align-items:flex-start}.composer-toolbar{right:20px;flex-wrap:wrap;height:auto}.random-btn{position:static;margin-left:0}.floating-generate{position:static;margin:16px 0 0;width:100%;display:flex}.composer-card{padding-bottom:20px}.settings-popover{top:90px}.settings-card{width:calc(100vw - 26px)}.history-panel{width:100vw;padding:60px 20px}.hero{margin-bottom:30px}}


/* ===== UI polish: smoother Pilio-like interactions ===== */
*{scroll-behavior:smooth}
.top-nav,.composer-card,.result-card,.settings-card,.history-panel{transition:box-shadow .28s ease, transform .28s ease, border-color .28s ease, background-color .28s ease}
.composer-card:hover,.result-card:hover{box-shadow:0 28px 90px rgba(20,25,40,.11)}
button,.mini-upload,.preview-item,.result-item,.hero-tags span,.model-pill,.setting-pill,.random-btn,.floating-generate,.clear-btn,.history-btn{
  transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}
button:hover,.model-pill:hover,.setting-pill:hover,.random-btn:hover,.clear-btn:hover,.history-btn:hover{transform:translateY(-1px)}
button:active,.model-pill:active,.setting-pill:active,.random-btn:active,.floating-generate:active{transform:translateY(1px) scale(.985)}
.model-pill:hover,.setting-pill:hover{border-color:#dfe2eb;box-shadow:0 10px 28px rgba(20,25,40,.08)}
.random-btn:hover,.floating-generate:hover{box-shadow:0 16px 32px rgba(0,0,0,.18);background:#151515}
textarea#prompt{transition:background-color .18s ease,color .18s ease}
.prompt-column:focus-within{background:linear-gradient(180deg,rgba(248,249,255,.7),rgba(255,255,255,0));border-radius:18px}
.prompt-column:focus-within .prompt-head span{color:#70778a}
.mini-upload:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(20,25,40,.06)}
.preview-item:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(20,25,40,.12)}
.result-item:hover{transform:translateY(-3px);box-shadow:0 18px 42px rgba(20,25,40,.14)}
.settings-popover{animation:popoverIn .18s cubic-bezier(.2,.8,.2,1)}
@keyframes popoverIn{from{opacity:0;transform:translateX(-50%) translateY(-8px) scale(.98)}to{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}}
.settings-card{box-shadow:0 30px 90px rgba(0,0,0,.16)}
.ratio-grid button:hover{background:#f7f7f8;transform:translateY(-1px)}
.ratio-grid button.active{background:#f0f0f2;box-shadow:inset 0 0 0 1px #dddfe6,0 8px 18px rgba(20,25,40,.05)}
.seg button:hover{color:#111;background:rgba(255,255,255,.55)}
.seg button.active{animation:segSelect .16s ease}
@keyframes segSelect{from{transform:scale(.94)}to{transform:scale(1)}}
.state{animation:fadeIn .24s ease}
.result-grid{animation:fadeIn .24s ease}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.floating-generate.loading .spark{animation:sparkSpin 1s linear infinite}
@keyframes sparkSpin{to{transform:rotate(360deg)}}
.spinner{box-shadow:0 0 0 8px rgba(125,107,255,.05)}
.history-panel{animation:historyIn .22s cubic-bezier(.2,.8,.2,1)}
@keyframes historyIn{from{opacity:0;transform:translateX(-50%) translateY(20px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
.modal-mask{animation:maskIn .18s ease}
@keyframes maskIn{from{opacity:0}to{opacity:1}}
.lightbox{animation:maskIn .18s ease}
.lightbox img{animation:zoomIn .2s cubic-bezier(.2,.8,.2,1)}
@keyframes zoomIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}


/* ===== Final: robust custom multi-reference uploader, no external component ===== */
.upload-column{
  display:block!important;
  width:142px!important;
  height:142px!important;
  min-width:142px!important;
  overflow:visible!important;
}
.composer-inner{
  grid-template-columns:150px 1fr!important;
  align-items:start!important;
}
.ref-uploader{
  position:relative;
  width:142px;
  height:138px;
  overflow:visible;
}
.ref-add{
  position:absolute;
  left:0;
  top:0;
  width:92px;
  height:132px;
  border:1px dashed #e1e4ec;
  background:#fbfbfc;
  border-radius:20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#8d95a5;
  z-index:1;
  padding:0;
  transition:transform .2s cubic-bezier(.2,.8,.2,1), opacity .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ref-plus{
  width:36px;
  height:36px;
  border-radius:999px;
  background:#eef0f4;
  color:#9aa0ad;
  display:grid;
  place-items:center;
  font-size:26px;
  line-height:1;
  margin-bottom:8px;
  transition:transform .2s ease, background .2s ease, color .2s ease;
}
.ref-main{font-size:13px;font-weight:600;color:#818998;line-height:1.5}
.ref-sub{font-size:12px;color:#98a0ad;line-height:1.5}
.ref-uploader:hover .ref-add,
.ref-uploader.dragover .ref-add{
  border-color:#c8bdff;
  background:#faf8ff;
  box-shadow:0 12px 30px rgba(20,25,40,.07);
}
.ref-uploader:hover .ref-plus,
.ref-uploader.dragover .ref-plus{
  transform:rotate(90deg) scale(1.06);
  background:#efeaff;
  color:#735cff;
}
.ref-preview-layer{
  position:absolute;
  left:0;
  top:0;
  width:142px;
  height:132px;
  overflow:visible;
  pointer-events:none;
}
.ref-card{
  position:absolute;
  width:78px;
  height:104px;
  top:0;
  left:4px;
  border-radius:17px;
  background:#fff;
  border:2px solid #fff;
  overflow:visible;
  box-shadow:0 14px 30px rgba(30,36,54,.14);
  pointer-events:auto;
  transform-origin:center bottom;
  animation:refIn .22s cubic-bezier(.2,.8,.2,1);
  transition:transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
@keyframes refIn{
  from{opacity:0;transform:translateY(8px) scale(.95) rotate(-4deg)}
  to{opacity:1;transform:translateY(0) scale(1) rotate(-4deg)}
}
.ref-card:nth-child(1){left:4px;top:0;z-index:4;transform:rotate(-4deg)}
.ref-card:nth-child(2){left:42px;top:3px;z-index:3;transform:rotate(5deg)}
.ref-card:nth-child(3){left:76px;top:7px;z-index:2;transform:rotate(-2deg)}
.ref-card:nth-child(n+4){display:none}
.ref-uploader:hover .ref-card:nth-child(1){transform:translateX(-2px) rotate(-4deg)}
.ref-uploader:hover .ref-card:nth-child(2){transform:translateX(7px) rotate(5deg)}
.ref-uploader:hover .ref-card:nth-child(3){transform:translateX(13px) rotate(-2deg)}
.ref-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:15px;
}
.ref-label{
  position:absolute;
  left:8px;
  bottom:7px;
  max-width:60px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(210,215,226,.9);
  border-radius:999px;
  padding:3px 7px;
  font-size:10px;
  line-height:1;
  color:#333a48;
  z-index:3;
  box-shadow:0 2px 8px rgba(20,25,40,.08);
}
.ref-remove{
  position:absolute;
  right:-8px;
  top:-8px;
  width:22px;
  height:22px;
  border-radius:999px;
  border:2px solid #fff;
  background:#222733;
  color:#fff;
  line-height:16px;
  padding:0;
  z-index:5;
  box-shadow:0 5px 14px rgba(0,0,0,.18);
  opacity:0;
  transform:scale(.85);
  transition:opacity .16s ease, transform .16s ease;
}
.ref-card:hover .ref-remove{opacity:1;transform:scale(1)}
.ref-more-add{
  position:absolute;
  left:96px;
  top:18px;
  width:62px;
  height:86px;
  border:1px dashed #e1e4ec;
  background:rgba(251,251,252,.94);
  color:#745cff;
  border-radius:17px;
  font-size:28px;
  line-height:1;
  z-index:10;
  box-shadow:0 12px 30px rgba(20,25,40,.05);
  opacity:0;
  pointer-events:none;
  transform:translateX(-12px) scale(.94);
  transition:opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s ease, background .18s ease;
}
.ref-uploader.has-files:hover .ref-more-add{
  opacity:1;
  pointer-events:auto;
  transform:translateX(0) scale(1);
}
.ref-more-add:hover{
  background:#f5f2ff;
  border-color:#c8bdff;
}
.ref-uploader.has-files .ref-add{
  opacity:0;
  transform:scale(.92);
  pointer-events:none;
}
.ref-count{
  position:absolute;
  right:-6px;
  bottom:25px;
  z-index:20;
  min-width:24px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  background:#242833;
  color:#fff;
  border:2px solid #fff;
  box-shadow:0 5px 14px rgba(0,0,0,.18);
  font-size:11px;
  align-items:center;
  justify-content:center;
  display:none;
}

/* Icon replacements for dropdowns/buttons */
.model-icon{
  width:20px;height:20px;display:inline-block;position:relative;border-radius:50%;
  background:conic-gradient(from 35deg,#394255,#aab1bf,#394255);
}
.model-icon:before{
  content:"";position:absolute;inset:4px;border-radius:50%;background:#fff;border:1.4px solid #5d6678;
}
.model-icon:after{
  content:"";position:absolute;left:2px;right:2px;top:9px;border-top:1.6px solid #5d6678;transform:rotate(-25deg);
}
.ratio-toolbar-icon{
  width:17px;height:17px;display:inline-block;position:relative;border:1.6px solid #7a8294;border-radius:4px;
}
.ratio-toolbar-icon:before{content:"";position:absolute;left:3px;right:3px;top:7px;border-top:1.4px solid #7a8294}
.ratio-toolbar-icon:after{content:"";position:absolute;top:3px;bottom:3px;left:7px;border-left:1.4px solid #7a8294}
.chevron-icon{
  width:14px;height:14px;display:inline-block;position:relative;margin-left:2px;flex:none;
}
.chevron-icon:before{
  content:"";position:absolute;left:3px;top:4px;width:7px;height:7px;
  border-right:1.8px solid #6d7484;border-bottom:1.8px solid #6d7484;
  transform:rotate(45deg);transition:transform .18s ease, top .18s ease;
}
.setting-pill.open .chevron-icon:before{transform:rotate(225deg);top:7px}
.model-pill b,.setting-pill b,.swirl{display:none!important}
.model-pill,.setting-pill{gap:8px!important}
.wand-css-icon{
  width:16px;height:16px;display:inline-block;position:relative;margin-right:8px;flex:none;
}
.wand-css-icon:before{
  content:"";position:absolute;left:7px;top:1px;width:2px;height:15px;background:#fff;border-radius:999px;transform:rotate(35deg);
}
.wand-css-icon:after{
  content:"";position:absolute;left:1px;top:0;width:5px;height:5px;border:1.5px solid #fff;border-radius:50%;box-shadow:10px 7px 0 -1px #fff,3px 12px 0 -1px #fff;
}
.random-btn{display:flex!important;align-items:center!important;justify-content:center!important}
@media(max-width:760px){
  .upload-column{width:166px!important}
  .ref-uploader{width:166px}
  .ref-uploader.has-files .ref-more-add{opacity:1;pointer-events:auto}
}


/* ===== FINAL 2-column fixed reference uploader ===== */
/* 左侧固定宽度，2列排列，超过高度出现滚动条，上传按钮永远在最后 */
.composer-inner{
  grid-template-columns:190px 1fr!important;
  gap:20px!important;
  align-items:start!important;
}
.upload-column{
  width:180px!important;
  min-width:180px!important;
  height:154px!important;
  overflow:visible!important;
  display:block!important;
}
.ref-uploader{
  width:180px!important;
  height:150px!important;
  position:relative!important;
  overflow:hidden!important;
  border-right:1px solid transparent;
}

/* 滚动区域：两列 */
.ref-preview-layer{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:180px!important;
  height:150px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  display:grid!important;
  grid-template-columns:repeat(2, 76px)!important;
  grid-auto-rows:96px!important;
  gap:10px!important;
  align-content:start!important;
  padding:2px 4px 8px 2px!important;
  pointer-events:auto!important;
  scrollbar-width:thin!important;
  scrollbar-color:#d8dce7 transparent!important;
}
.ref-preview-layer::-webkit-scrollbar{width:5px!important}
.ref-preview-layer::-webkit-scrollbar-track{background:transparent!important}
.ref-preview-layer::-webkit-scrollbar-thumb{background:#d8dce7!important;border-radius:999px!important}

/* 每张参考图：稳定网格，不叠放 */
.ref-card{
  position:relative!important;
  display:block!important;
  left:auto!important;
  top:auto!important;
  width:76px!important;
  height:96px!important;
  border-radius:16px!important;
  background:#fff!important;
  border:2px solid #fff!important;
  overflow:hidden!important;
  box-shadow:0 8px 20px rgba(30,36,54,.12)!important;
  transform:none!important;
  z-index:auto!important;
  pointer-events:auto!important;
  animation:refGridIn .18s cubic-bezier(.2,.8,.2,1)!important;
  transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease!important;
}
@keyframes refGridIn{
  from{opacity:0;transform:translateY(6px) scale(.96)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.ref-card:nth-child(n){
  left:auto!important;
  top:auto!important;
  transform:none!important;
  z-index:auto!important;
}
.ref-card:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 12px 26px rgba(30,36,54,.18)!important;
}
.ref-card img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
  border-radius:14px!important;
}
.ref-label{
  position:absolute!important;
  left:6px!important;
  right:6px!important;
  bottom:6px!important;
  max-width:none!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  text-align:center!important;
  background:rgba(255,255,255,.94)!important;
  border:1px solid rgba(210,215,226,.9)!important;
  border-radius:999px!important;
  padding:3px 5px!important;
  font-size:10px!important;
  line-height:1!important;
  color:#333a48!important;
  z-index:3!important;
  box-shadow:0 2px 8px rgba(20,25,40,.08)!important;
}
.ref-remove{
  position:absolute!important;
  right:3px!important;
  top:3px!important;
  width:20px!important;
  height:20px!important;
  border-radius:999px!important;
  border:2px solid #fff!important;
  background:#20242e!important;
  color:#fff!important;
  line-height:14px!important;
  padding:0!important;
  z-index:10!important;
  box-shadow:0 4px 12px rgba(0,0,0,.18)!important;
  opacity:0!important;
  transform:scale(.86)!important;
  transition:opacity .16s ease, transform .16s ease!important;
}
.ref-card:hover .ref-remove{
  opacity:1!important;
  transform:scale(1)!important;
}

/* 上传按钮：变成网格里的最后一个格子 */
.ref-add{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:76px!important;
  height:96px!important;
  border:1.5px dashed #dfe3ec!important;
  background:#fbfbfc!important;
  border-radius:16px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  color:#8d95a5!important;
  z-index:auto!important;
  padding:0!important;
  opacity:1!important;
  pointer-events:auto!important;
  transform:none!important;
  box-shadow:none!important;
  transition:transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s ease, background .18s ease, box-shadow .18s ease!important;
}
.ref-add:hover,
.ref-uploader.dragover .ref-add{
  transform:translateY(-2px)!important;
  border-color:#c8bdff!important;
  background:#faf8ff!important;
  box-shadow:0 10px 22px rgba(20,25,40,.08)!important;
}
.ref-plus{
  width:30px!important;
  height:30px!important;
  border-radius:999px!important;
  background:#eef0f4!important;
  color:#9aa0ad!important;
  display:grid!important;
  place-items:center!important;
  font-size:23px!important;
  line-height:1!important;
  margin-bottom:6px!important;
  transition:transform .18s ease, background .18s ease, color .18s ease!important;
}
.ref-add:hover .ref-plus,
.ref-uploader.dragover .ref-plus{
  transform:rotate(90deg) scale(1.05)!important;
  background:#efeaff!important;
  color:#735cff!important;
}
.ref-main{
  font-size:11px!important;
  font-weight:600!important;
  color:#818998!important;
  line-height:1.35!important;
}
.ref-sub{
  font-size:10px!important;
  color:#98a0ad!important;
  line-height:1.35!important;
}

/* 不再使用浮动添加按钮和数量角标 */
.ref-more-add,
.ref-count{
  display:none!important;
}

/* 由 JS 将上传按钮插入到列表末尾，这里确保原位置不占位 */
.ref-uploader > .ref-add{
  display:none!important;
}
.ref-preview-layer > .ref-add{
  display:flex!important;
}

/* 文本区不被参考图区覆盖 */
.prompt-column{
  min-width:0!important;
  padding-left:0!important;
}

/* 小图标保持 */
.model-pill b,.setting-pill b,.swirl{display:none!important}

@media(max-width:760px){
  .composer-inner{grid-template-columns:1fr!important}
  .upload-column,.ref-uploader{width:180px!important}
}


/* ===== Fix initial upload button visibility ===== */
.ref-uploader:not(.has-files) > .ref-add{
  display:flex!important;
  position:relative!important;
  left:2px!important;
  top:2px!important;
}
.ref-uploader.has-files > .ref-add{
  display:none!important;
}


/* =========================================================
   Premium Visual UI Patch
   - CSS drawn icons
   - Better centered plus icons
   - Smoother hover/active feedback
   - More refined upload/reference area
   ========================================================= */

/* 统一高级动效 */
button,
.ref-add,
.ref-card,
.model-pill,
.setting-pill,
.random-btn,
.floating-generate,
.clear-btn,
.history-btn{
  transition:
    transform .18s cubic-bezier(.2,.8,.2,1),
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    opacity .18s ease !important;
}
button:active{
  transform:scale(.985) !important;
}

/* 上传卡片视觉升级 */
.ref-add{
  background:linear-gradient(180deg,#ffffff 0%,#fbfbfd 100%)!important;
  border-color:#e1e5ef!important;
  box-shadow:0 8px 22px rgba(20,25,40,.045)!important;
}
.ref-add:hover{
  border-color:#bcaeff!important;
  background:linear-gradient(180deg,#fff 0%,#faf7ff 100%)!important;
  box-shadow:0 14px 30px rgba(109,93,252,.11)!important;
}

/* 替换文字 + 为 CSS 绘制 +，保证视觉居中 */
.ref-plus{
  position:relative!important;
  width:32px!important;
  height:32px!important;
  border-radius:999px!important;
  background:#eef0f5!important;
  color:transparent!important;
  font-size:0!important;
  display:block!important;
  margin:0 0 8px 0!important;
}
.ref-plus::before,
.ref-plus::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  background:#9aa1ad!important;
  border-radius:99px!important;
  transform:translate(-50%,-50%)!important;
}
.ref-plus::before{
  width:15px!important;
  height:2px!important;
}
.ref-plus::after{
  width:2px!important;
  height:15px!important;
}
.ref-add:hover .ref-plus,
.ref-uploader.dragover .ref-plus{
  background:#efeaff!important;
  transform:rotate(90deg) scale(1.05)!important;
}
.ref-add:hover .ref-plus::before,
.ref-add:hover .ref-plus::after,
.ref-uploader.dragover .ref-plus::before,
.ref-uploader.dragover .ref-plus::after{
  background:#735cff!important;
}

/* 上传参考图卡片更精细 */
.ref-card{
  border:2px solid rgba(255,255,255,.96)!important;
  box-shadow:0 10px 24px rgba(24,30,46,.14)!important;
}
.ref-card:hover{
  transform:translateY(-2px) scale(1.015)!important;
  box-shadow:0 16px 34px rgba(24,30,46,.20)!important;
}
.ref-label{
  background:rgba(255,255,255,.94)!important;
  backdrop-filter:blur(8px)!important;
  border-color:rgba(214,219,230,.86)!important;
  color:#343a47!important;
  font-weight:600!important;
}
.ref-remove{
  background:rgba(31,35,45,.92)!important;
  backdrop-filter:blur(8px)!important;
  font-size:0!important;
}
.ref-remove::before,
.ref-remove::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:10px!important;
  height:1.8px!important;
  background:#fff!important;
  border-radius:99px!important;
}
.ref-remove::before{transform:translate(-50%,-50%) rotate(45deg)!important}
.ref-remove::after{transform:translate(-50%,-50%) rotate(-45deg)!important}

/* 工具栏图标统一为 CSS 绘制，隐藏低质文字/符号 */
.model-pill b,
.setting-pill b,
.swirl{
  display:none!important;
}

/* GPT Image 2 模型图标 */
.model-icon{
  width:20px!important;
  height:20px!important;
  flex:0 0 20px!important;
  display:inline-block!important;
  position:relative!important;
  border-radius:50%!important;
  background:
    radial-gradient(circle at center,#fff 0 42%,transparent 43%),
    conic-gradient(from 20deg,#485265,#9aa4b7,#485265,#d0d5df,#485265)!important;
  box-shadow:inset 0 0 0 1px rgba(54,63,80,.18)!important;
}
.model-icon::before{
  content:""!important;
  position:absolute!important;
  left:-3px!important;
  right:-3px!important;
  top:9px!important;
  height:2px!important;
  border-radius:99px!important;
  background:#677183!important;
  transform:rotate(-25deg)!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.78)!important;
}
.model-icon::after{
  content:""!important;
  position:absolute!important;
  inset:5px!important;
  border-radius:50%!important;
  border:1.5px solid #687286!important;
}

/* 比例/布局小图标 */
.ratio-toolbar-icon{
  width:17px!important;
  height:17px!important;
  flex:0 0 17px!important;
  display:inline-block!important;
  position:relative!important;
  border:1.6px solid #7a8294!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#fff,#f8f9fb)!important;
}
.ratio-toolbar-icon::before{
  content:""!important;
  position:absolute!important;
  left:3px!important;
  right:3px!important;
  top:7px!important;
  border-top:1.5px solid #7a8294!important;
}
.ratio-toolbar-icon::after{
  content:""!important;
  position:absolute!important;
  top:3px!important;
  bottom:3px!important;
  left:7px!important;
  border-left:1.5px solid #7a8294!important;
}

/* 下拉箭头：CSS绘制，顺滑旋转 */
.chevron-icon{
  width:14px!important;
  height:14px!important;
  flex:0 0 14px!important;
  display:inline-block!important;
  position:relative!important;
  margin-left:2px!important;
}
.chevron-icon::before{
  content:""!important;
  position:absolute!important;
  left:3px!important;
  top:4px!important;
  width:7px!important;
  height:7px!important;
  border-right:1.8px solid #6d7484!important;
  border-bottom:1.8px solid #6d7484!important;
  transform:rotate(45deg)!important;
  transition:transform .18s cubic-bezier(.2,.8,.2,1), top .18s ease!important;
}
.setting-pill.open .chevron-icon::before{
  top:7px!important;
  transform:rotate(225deg)!important;
}

/* 魔法棒按钮 */
.wand-css-icon,
.wand-icon{
  width:17px!important;
  height:17px!important;
  flex:0 0 17px!important;
  display:inline-block!important;
  position:relative!important;
  margin-right:8px!important;
}
.wand-css-icon::before,
.wand-icon::before{
  content:""!important;
  position:absolute!important;
  left:8px!important;
  top:1px!important;
  width:2px!important;
  height:15px!important;
  background:#fff!important;
  border-radius:99px!important;
  transform:rotate(35deg)!important;
}
.wand-css-icon::after,
.wand-icon::after{
  content:""!important;
  position:absolute!important;
  left:1px!important;
  top:0!important;
  width:5px!important;
  height:5px!important;
  border:1.5px solid #fff!important;
  border-radius:50%!important;
  box-shadow:10px 7px 0 -1px #fff,3px 12px 0 -1px #fff!important;
}

/* 工具栏按钮质感 */
.model-pill,
.setting-pill{
  background:rgba(255,255,255,.92)!important;
  border:1px solid rgba(225,229,238,.95)!important;
  box-shadow:0 6px 18px rgba(20,25,40,.045)!important;
}
.model-pill:hover,
.setting-pill:hover{
  transform:translateY(-1px)!important;
  border-color:#d7dce8!important;
  box-shadow:0 10px 26px rgba(20,25,40,.08)!important;
}
.setting-pill.open{
  border-color:#c9c0ff!important;
  box-shadow:0 12px 30px rgba(109,93,252,.12)!important;
}
.model-pill em{
  background:linear-gradient(180deg,#f6f7fa,#eef0f5)!important;
  border:1px solid #e3e6ee!important;
  color:#6c7483!important;
}

/* 生成按钮 */
.random-btn,
.floating-generate{
  background:linear-gradient(180deg,#111 0%,#050505 100%)!important;
  box-shadow:0 12px 26px rgba(0,0,0,.15)!important;
}
.random-btn:hover,
.floating-generate:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 18px 36px rgba(0,0,0,.20)!important;
}
.random-btn:active,
.floating-generate:active{
  transform:translateY(1px) scale(.985)!important;
}

/* 参数弹窗高级感 */
.settings-card{
  background:rgba(255,255,255,.98)!important;
  border:1px solid rgba(230,233,241,.95)!important;
  box-shadow:0 30px 90px rgba(20,25,40,.16)!important;
}
.ratio-grid button{
  transition:background .16s ease, transform .16s ease, box-shadow .16s ease!important;
}
.ratio-grid button:hover{
  background:#f7f7fa!important;
  transform:translateY(-1px)!important;
}
.ratio-grid button.active{
  background:#f0f0f3!important;
  box-shadow:inset 0 0 0 1px #dedfe6,0 8px 18px rgba(20,25,40,.05)!important;
}
.seg button{
  transition:background .16s ease, color .16s ease, transform .16s ease!important;
}
.seg button.active{
  background:#fff!important;
  color:#111827!important;
  box-shadow:0 2px 8px rgba(20,25,40,.08)!important;
}

/* 输入框卡片整体更轻盈 */
.composer-card,
.result-card{
  box-shadow:0 26px 80px rgba(20,25,40,.085)!important;
}
.composer-card:hover,
.result-card:hover{
  box-shadow:0 30px 90px rgba(20,25,40,.105)!important;
}

/* 减少浏览器默认 tooltip 带来的廉价感：按钮只靠 UI 表达 */
.ref-more-add[title],
.ref-remove[title]{
  pointer-events:auto;
}


/* ===== Bugfix: remove duplicate prompt hint + prevent random/generate button overlap ===== */
.prompt-head-clean{
  min-height:24px!important;
  padding:0 0 2px!important;
}
.prompt-head-clean span{
  display:none!important;
}

/* 底部工具栏重新分配空间：左侧参数，右侧按钮区，互不重叠 */
.composer-toolbar{
  right:20px!important;
  left:20px!important;
  bottom:20px!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  padding-right:160px!important; /* 给右侧生成按钮留安全区 */
  height:44px!important;
  overflow:visible!important;
}

/* 随机按钮和生成按钮使用同一个右下位置，但互斥显示 */
.random-btn{
  position:absolute!important;
  right:0!important;
  top:0!important;
  height:44px!important;
  min-width:146px!important;
  margin-left:0!important;
  z-index:2!important;
}
.floating-generate{
  position:absolute!important;
  right:20px!important;
  bottom:20px!important;
  height:44px!important;
  min-width:146px!important;
  z-index:4!important;
}

/* 没有输入内容：显示随机按钮，隐藏生成按钮 */
.composer-card:not(.has-text) .random-btn{
  display:flex!important;
}
.composer-card:not(.has-text) .floating-generate{
  display:none!important;
}

/* 有输入内容：隐藏随机按钮，只显示生成按钮 */
.composer-card.has-text .random-btn{
  display:none!important;
}
.composer-card.has-text .floating-generate{
  display:flex!important;
}

/* 避免旧规则导致按钮文本残留重叠 */
.floating-generate .btn-loading{
  display:none!important;
}
.floating-generate.loading .btn-text{
  display:none!important;
}
.floating-generate.loading .btn-loading{
  display:inline!important;
}
.floating-generate.loading .spark{
  display:inline-block!important;
  animation:sparkSpin 1s linear infinite!important;
}

/* 输入区上方减少空白，让视觉更像一个整体输入框 */
textarea#prompt{
  padding-top:0!important;
}

@media(max-width:760px){
  .composer-toolbar{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    padding-right:0!important;
    flex-wrap:wrap!important;
    height:auto!important;
    margin-top:12px!important;
  }
  .random-btn{
    position:static!important;
    width:100%!important;
  }
  .floating-generate{
    position:static!important;
    width:100%!important;
    margin-top:12px!important;
  }
}


/* =========================================================
   Multi-task result stream
   ========================================================= */
.result-grid{
  display:flex!important;
  flex-direction:column!important;
  gap:24px!important;
  padding-top:22px!important;
}
.task-card{
  background:#fff;
  border:1px solid #eef0f5;
  border-radius:24px;
  padding:18px;
  box-shadow:0 18px 46px rgba(20,25,40,.06);
  animation:taskIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes taskIn{
  from{opacity:0;transform:translateY(10px) scale(.99)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.task-head{
  display:grid;
  grid-template-columns:52px 1fr auto;
  align-items:start;
  gap:14px;
  padding-bottom:14px;
  border-bottom:1px solid #f0f2f6;
}
.task-ref{
  width:44px;
  height:44px;
  border-radius:14px;
  overflow:hidden;
  background:#f5f6fa;
  display:grid;
  place-items:center;
  color:#7b8496;
  border:1px solid #ebedf3;
}
.task-ref img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.task-info{min-width:0}
.task-prompt{
  font-size:15px;
  line-height:1.55;
  color:#20242f;
  max-height:48px;
  overflow:hidden;
}
.task-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.task-meta span{
  font-size:12px;
  color:#747d90;
  background:#f7f8fb;
  border:1px solid #edf0f5;
  border-radius:999px;
  padding:3px 8px;
}
.task-status{
  display:flex;
  align-items:center;
  gap:7px;
  color:#8a92a4;
  white-space:nowrap;
  font-size:13px;
}
.task-status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#f5a623;
  box-shadow:0 0 0 4px rgba(245,166,35,.12);
}
.task-card.is-done .task-status-dot{
  background:#2ecc71;
  box-shadow:0 0 0 4px rgba(46,204,113,.12);
}
.task-card.is-failed .task-status-dot{
  background:#ff4d4f;
  box-shadow:0 0 0 4px rgba(255,77,79,.12);
}
.task-body{
  padding-top:16px;
}
.task-image-placeholder{
  width:240px;
  height:240px;
  border-radius:22px;
  background:linear-gradient(180deg,#fbfbfd,#f6f7fb);
  border:1px solid #eef0f5;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#9aa2b3;
  margin:0 auto;
}
.spinner.mini{
  width:28px!important;
  height:28px!important;
  border-width:3px!important;
  margin:0 0 10px!important;
}
.task-images-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}
.task-image-item{
  position:relative;
  min-height:220px;
  border-radius:20px;
  overflow:hidden;
  background:#f3f4f8;
  border:1px solid #eef0f5;
  box-shadow:0 10px 26px rgba(20,25,40,.06);
}
.task-image-item img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.task-image-actions{
  position:absolute;
  right:10px;
  bottom:10px;
  display:flex;
  gap:8px;
  opacity:0;
  transform:translateY(8px);
  transition:.18s ease;
}
.task-image-item:hover .task-image-actions{
  opacity:1;
  transform:translateY(0);
}
.task-image-actions a,
.task-image-actions button{
  border:0;
  background:rgba(0,0,0,.78);
  color:#fff;
  border-radius:999px;
  padding:8px 12px;
  font-size:13px;
  text-decoration:none;
}
.task-actions-row{
  display:flex;
  justify-content:center;
  margin-top:14px;
}
.task-stop-btn{
  border:0;
  border-radius:999px;
  background:#080808;
  color:#fff;
  padding:8px 16px;
  font-weight:700;
  font-size:13px;
}
.task-error{
  border:1px solid #ffd6d6;
  background:#fff7f7;
  color:#b42318;
  border-radius:16px;
  padding:14px;
  line-height:1.6;
  font-size:13px;
}
.floating-generate.submitting{
  opacity:.75;
}
.floating-generate.submitting .spark{
  animation:sparkSpin 1s linear infinite!important;
}
@media(max-width:760px){
  .task-head{
    grid-template-columns:44px 1fr;
  }
  .task-status{
    grid-column:1 / -1;
  }
  .task-image-placeholder{
    width:100%;
  }
}


/* ===== Toolbar & history refinement patch ===== */

/* 历史按钮：更小，贴近输入区右上角 */
.composer-card{
  position:relative!important;
}
.prompt-column{
  position:relative!important;
}
.prompt-head-clean{
  position:absolute!important;
  right:10px!important;
  top:4px!important;
  z-index:8!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  pointer-events:none!important;
}
.prompt-head-clean span:not(.history-icon){
  display:none!important;
}
.history-btn{
  pointer-events:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  border:0!important;
  background:transparent!important;
  color:#6f7788!important;
  font-size:12px!important;
  font-weight:600!important;
  line-height:1!important;
  padding:4px 5px!important;
  border-radius:8px!important;
  height:22px!important;
}
.history-btn:hover{
  background:#f3f5f8!important;
  color:#3f4654!important;
  transform:none!important;
}
.history-icon{
  width:13px!important;
  height:13px!important;
  display:inline-block!important;
  position:relative!important;
  border:1.6px solid currentColor!important;
  border-left-color:transparent!important;
  border-radius:50%!important;
}
.history-icon::before{
  content:""!important;
  position:absolute!important;
  left:-3px!important;
  top:1px!important;
  width:5px!important;
  height:5px!important;
  border-left:1.6px solid currentColor!important;
  border-top:1.6px solid currentColor!important;
  transform:rotate(-35deg)!important;
}

/* 给右上角历史按钮留空间，placeholder 不和历史重叠 */
textarea#prompt{
  padding-right:86px!important;
}

/* 模型和参数选项：更轻、更小、更接近 Pilio */
.composer-toolbar{
  gap:10px!important;
}
.model-pill,
.setting-pill{
  height:34px!important;
  min-height:34px!important;
  padding:0 12px!important;
  border-radius:999px!important;
  font-size:13px!important;
  color:#596173!important;
  font-weight:500!important;
  background:rgba(255,255,255,.9)!important;
  border:1px solid #e8ebf2!important;
  box-shadow:0 4px 14px rgba(20,25,40,.04)!important;
  gap:7px!important;
  align-items:center!important;
}
.model-pill:hover,
.setting-pill:hover{
  color:#343b49!important;
  border-color:#dfe3ec!important;
  box-shadow:0 8px 20px rgba(20,25,40,.065)!important;
  transform:translateY(-1px)!important;
}
.model-name{
  font-size:13px!important;
  color:#4e5666!important;
  font-weight:500!important;
}
.model-pill em{
  font-size:10px!important;
  line-height:1!important;
  padding:3px 6px!important;
  border-radius:999px!important;
  color:#8a92a3!important;
  background:#f4f6f9!important;
  border:1px solid #e8ebf1!important;
}

/* 参数使用 | 分隔 */
.setting-pill strong{
  font-size:13px!important;
  color:#4e5666!important;
  font-weight:600!important;
  line-height:1!important;
  display:inline-flex!important;
  align-items:center!important;
}
.setting-sep{
  width:1px!important;
  height:12px!important;
  background:#dfe3eb!important;
  display:inline-block!important;
  margin:0 1px!important;
}

/* 工具栏图标尺寸统一 */
.model-icon{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
}
.model-icon::before{
  top:7px!important;
  left:-2px!important;
  right:-2px!important;
  height:1.4px!important;
}
.model-icon::after{
  inset:4px!important;
  border-width:1.2px!important;
}
.ratio-toolbar-icon{
  width:15px!important;
  height:15px!important;
  flex:0 0 15px!important;
  border-radius:4px!important;
}
.ratio-toolbar-icon::before{
  left:3px!important;
  right:3px!important;
  top:6px!important;
  border-top-width:1.2px!important;
}
.ratio-toolbar-icon::after{
  top:3px!important;
  bottom:3px!important;
  left:6px!important;
  border-left-width:1.2px!important;
}

/* 下拉箭头：与文字垂直居中 */
.chevron-icon{
  width:12px!important;
  height:12px!important;
  flex:0 0 12px!important;
  margin-left:0!important;
  align-self:center!important;
  position:relative!important;
  top:0!important;
}
.chevron-icon::before{
  left:3px!important;
  top:3px!important;
  width:6px!important;
  height:6px!important;
  border-right-width:1.5px!important;
  border-bottom-width:1.5px!important;
}
.setting-pill.open .chevron-icon::before{
  top:6px!important;
}

/* 输入区上方提示改为 textarea 的 placeholder 效果即可 */
.prompt-head-clean + textarea#prompt::placeholder{
  color:#9da5b4!important;
}


/* Access password version */
.logout-link{
  margin-right:14px;
  color:#6f7788;
  font-size:13px;
  font-weight:600;
  padding:7px 10px;
  border-radius:999px;
  text-decoration:none;
  transition:.18s ease;
}
.logout-link:hover{
  background:#f2f4f8;
  color:#1f2329;
}


/* ChatGPT official-style SVG logo in model pill */
.pill-logo{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  display:inline-block!important;
  color:#4e5666!important;
}
.model-pill:hover .pill-logo{
  color:#111!important;
}
/* Hide previous CSS-drawn fake model icon if any old markup remains */
.model-icon,
.swirl{
  display:none!important;
}
.model-name{
  font-size:13px!important;
  color:#4e5666!important;
  font-weight:500!important;
}


/* Force ChatGPT SVG logo visible in model pill */
.model-pill .pill-logo{
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  display:inline-block!important;
  color:#4e5666!important;
  vertical-align:middle!important;
}
.model-pill:hover .pill-logo{
  color:#111!important;
}
.model-pill .model-icon,
.model-pill .swirl{
  display:none!important;
}


/* =========================================================
   Commercial UI Final Polish
   - Perfect vertical/horizontal alignment
   - Premium pill buttons
   - Cleaner icon baseline
   - Smooth hover/active interactions
   ========================================================= */

/* 通用按钮手感 */
.model-pill,
.setting-pill,
.random-btn,
.floating-generate,
.clear-btn,
.history-btn,
.ref-add,
.ref-card,
.task-card{
  transition:
    transform .18s cubic-bezier(.2,.8,.2,1),
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    opacity .18s ease !important;
}

/* 工具栏整体 */
.composer-toolbar{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
}

/* 模型按钮：商业级居中 */
.model-pill{
  height:34px!important;
  min-height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  padding:0 12px!important;
  border-radius:999px!important;
  border:1px solid rgba(226,230,239,.98)!important;
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%)!important;
  box-shadow:
    0 4px 12px rgba(20,25,40,.045),
    inset 0 1px 0 rgba(255,255,255,.85)!important;
  font-size:13px!important;
  line-height:1!important;
  color:#4e5666!important;
  white-space:nowrap!important;
}

.model-pill:hover{
  transform:translateY(-1px)!important;
  border-color:#d7ddea!important;
  box-shadow:
    0 10px 24px rgba(20,25,40,.075),
    inset 0 1px 0 rgba(255,255,255,.95)!important;
  color:#20242f!important;
}

.model-pill:active{
  transform:translateY(0) scale(.985)!important;
}

/* ChatGPT SVG 图标：解决 baseline 偏移 */
.model-pill .pill-logo{
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  flex:0 0 16px!important;
  display:block!important;
  color:#4e5666!important;
  position:relative!important;
  top:0!important;
  margin:0!important;
  line-height:1!important;
}

.model-pill:hover .pill-logo{
  color:#151922!important;
}

/* 模型文字 */
.model-name{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:16px!important;
  font-size:13px!important;
  line-height:1!important;
  color:#4e5666!important;
  font-weight:500!important;
  letter-spacing:.01em!important;
  margin:0!important;
  padding:0!important;
}

.model-pill:hover .model-name{
  color:#20242f!important;
}

/* 推荐标签 */
.model-pill em{
  height:18px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 6px!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,#f6f8fb 0%,#eef1f6 100%)!important;
  border:1px solid #e5e9f1!important;
  color:#7c8494!important;
  font-size:10px!important;
  line-height:1!important;
  font-style:normal!important;
  font-weight:600!important;
  margin:0!important;
}

/* 参数按钮 */
.setting-pill{
  height:34px!important;
  min-height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  padding:0 12px!important;
  border-radius:999px!important;
  border:1px solid rgba(226,230,239,.98)!important;
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%)!important;
  box-shadow:
    0 4px 12px rgba(20,25,40,.045),
    inset 0 1px 0 rgba(255,255,255,.85)!important;
  color:#4e5666!important;
  font-size:13px!important;
  line-height:1!important;
  white-space:nowrap!important;
}

.setting-pill:hover{
  transform:translateY(-1px)!important;
  border-color:#d7ddea!important;
  box-shadow:
    0 10px 24px rgba(20,25,40,.075),
    inset 0 1px 0 rgba(255,255,255,.95)!important;
}

.setting-pill.open{
  border-color:#c9c0ff!important;
  box-shadow:
    0 12px 28px rgba(109,93,252,.13),
    inset 0 1px 0 rgba(255,255,255,.95)!important;
}

.setting-pill strong{
  height:16px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:13px!important;
  line-height:1!important;
  color:#4e5666!important;
  font-weight:600!important;
  margin:0!important;
  padding:0!important;
}

.setting-sep{
  width:1px!important;
  height:12px!important;
  display:inline-block!important;
  background:#dfe3eb!important;
  margin:0 1px!important;
  flex:0 0 1px!important;
}

/* 比例图标居中 */
.ratio-toolbar-icon{
  width:15px!important;
  height:15px!important;
  flex:0 0 15px!important;
  display:block!important;
  position:relative!important;
  top:0!important;
  margin:0!important;
  border:1.5px solid #7a8294!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#fff,#f8f9fb)!important;
}

.ratio-toolbar-icon::before{
  content:""!important;
  position:absolute!important;
  left:3px!important;
  right:3px!important;
  top:6px!important;
  border-top:1.3px solid #7a8294!important;
}

.ratio-toolbar-icon::after{
  content:""!important;
  position:absolute!important;
  top:3px!important;
  bottom:3px!important;
  left:6px!important;
  border-left:1.3px solid #7a8294!important;
}

/* 下拉箭头：精确居中 */
.chevron-icon{
  width:12px!important;
  height:12px!important;
  flex:0 0 12px!important;
  display:block!important;
  position:relative!important;
  top:0!important;
  margin:0!important;
}

.chevron-icon::before{
  content:""!important;
  position:absolute!important;
  left:3px!important;
  top:3px!important;
  width:6px!important;
  height:6px!important;
  border-right:1.5px solid #6d7484!important;
  border-bottom:1.5px solid #6d7484!important;
  transform:rotate(45deg)!important;
  transition:transform .18s cubic-bezier(.2,.8,.2,1), top .18s ease!important;
}

.setting-pill.open .chevron-icon::before{
  top:6px!important;
  transform:rotate(225deg)!important;
}

/* 生成 / 随机按钮高级质感 */
.random-btn,
.floating-generate{
  height:44px!important;
  min-width:146px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  border-radius:18px!important;
  background:
    radial-gradient(circle at 20% 0%,rgba(255,255,255,.16),transparent 38%),
    linear-gradient(180deg,#151515 0%,#050505 100%)!important;
  color:#fff!important;
  box-shadow:
    0 16px 34px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.12)!important;
  font-weight:800!important;
  letter-spacing:.01em!important;
}

.random-btn:hover,
.floating-generate:hover{
  transform:translateY(-1px)!important;
  box-shadow:
    0 22px 44px rgba(0,0,0,.23),
    inset 0 1px 0 rgba(255,255,255,.16)!important;
}

.random-btn:active,
.floating-generate:active{
  transform:translateY(1px) scale(.985)!important;
}

/* 魔法棒图标居中 */
.wand-css-icon,
.wand-icon{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  display:block!important;
  position:relative!important;
  margin:0!important;
}

.wand-css-icon::before,
.wand-icon::before{
  content:""!important;
  position:absolute!important;
  left:7px!important;
  top:1px!important;
  width:2px!important;
  height:15px!important;
  background:#fff!important;
  border-radius:99px!important;
  transform:rotate(35deg)!important;
}

.wand-css-icon::after,
.wand-icon::after{
  content:""!important;
  position:absolute!important;
  left:1px!important;
  top:0!important;
  width:5px!important;
  height:5px!important;
  border:1.5px solid #fff!important;
  border-radius:50%!important;
  box-shadow:
    10px 7px 0 -1px #fff,
    3px 12px 0 -1px #fff!important;
}

/* 卡片更轻盈 */
.composer-card,
.result-card{
  border-color:rgba(235,238,246,.95)!important;
  box-shadow:
    0 28px 90px rgba(20,25,40,.085),
    inset 0 1px 0 rgba(255,255,255,.82)!important;
}

.composer-card:hover,
.result-card:hover{
  box-shadow:
    0 34px 100px rgba(20,25,40,.105),
    inset 0 1px 0 rgba(255,255,255,.9)!important;
}

/* 清理旧图标影响 */
.model-icon,
.swirl{
  display:none!important;
}


/* =========================================================
   Batch Generation UI
   ========================================================= */
.batch-open-btn{
  height:44px!important;
  min-width:126px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  border:0!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8f9fc 100%)!important;
  color:#3f4654!important;
  box-shadow:0 10px 24px rgba(20,25,40,.075), inset 0 1px 0 rgba(255,255,255,.9)!important;
  font-weight:800!important;
  border:1px solid #e4e8f1!important;
}
.batch-open-btn:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 16px 34px rgba(20,25,40,.10), inset 0 1px 0 rgba(255,255,255,.96)!important;
  border-color:#d6dce9!important;
}
.batch-icon{
  width:15px;
  height:15px;
  display:inline-grid;
  grid-template-columns:1fr 1fr;
  gap:2px;
}
.batch-icon::before,
.batch-icon::after{
  content:"";
}
.batch-icon,
.batch-icon::before,
.batch-icon::after{
  position:relative;
}
.batch-icon{
  background:
    linear-gradient(#5f6878,#5f6878) 0 0/6px 6px no-repeat,
    linear-gradient(#5f6878,#5f6878) 9px 0/6px 6px no-repeat,
    linear-gradient(#5f6878,#5f6878) 0 9px/6px 6px no-repeat,
    linear-gradient(#5f6878,#5f6878) 9px 9px/6px 6px no-repeat;
  border-radius:3px;
}

.batch-panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(860px,calc(100vw - 36px));
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border:1px solid #eceef4;
  border-radius:28px;
  box-shadow:0 34px 110px rgba(0,0,0,.20);
  padding:30px;
  animation:batchIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes batchIn{
  from{opacity:0;transform:translate(-50%,-47%) scale(.98)}
  to{opacity:1;transform:translate(-50%,-50%) scale(1)}
}
.batch-head{
  text-align:center;
  margin-bottom:22px;
}
.batch-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:24px;
  padding:0 10px;
  border-radius:999px;
  background:#f4f1ff;
  color:#735cff;
  font-size:12px;
  font-weight:800;
  margin-bottom:10px;
}
.batch-head h2{
  margin:0 0 8px;
  font-size:26px;
}
.batch-head p{
  margin:0;
  color:#727b8d;
  font-size:14px;
}
.batch-tools{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}
.batch-upload,
.batch-secondary{
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border-radius:999px;
  padding:0 14px;
  border:1px solid #e4e8f1;
  background:#fff;
  color:#4c5566;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(20,25,40,.045);
}
.batch-upload:hover,
.batch-secondary:hover{
  transform:translateY(-1px);
  border-color:#d7ddea;
  box-shadow:0 10px 22px rgba(20,25,40,.07);
}
.batch-upload-icon{
  width:20px;
  height:20px;
  border-radius:50%;
  background:#f0eefc;
  color:#735cff;
  display:grid;
  place-items:center;
  font-size:16px;
}
.batch-concurrency{
  margin-left:auto;
  height:38px;
  display:inline-flex;
  align-items:center;
  gap:9px;
  color:#667085;
  font-size:13px;
  font-weight:700;
}
.batch-concurrency select{
  height:38px;
  min-width:72px;
  border:1px solid #e4e8f1;
  border-radius:999px;
  padding:0 12px;
  outline:none;
  background:#fff;
  color:#303746;
  font-weight:800;
}
.batch-textarea{
  width:100%;
  min-height:220px;
  resize:vertical;
  border:1px solid #e4e8f1;
  border-radius:20px;
  padding:16px;
  outline:none;
  background:#fbfcff;
  line-height:1.7;
  font-size:14px;
}
.batch-textarea:focus{
  border-color:#9a8bff;
  box-shadow:0 0 0 4px rgba(115,92,255,.10);
}
.batch-summary{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:#8a93a5;
  font-size:13px;
  margin:12px 2px;
}
.batch-summary span:first-child{
  color:#303746;
  font-weight:800;
}
.batch-preview{
  max-height:180px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:2px;
}
.batch-preview-item{
  display:grid;
  grid-template-columns:28px 1fr;
  gap:10px;
  align-items:start;
  padding:10px 12px;
  background:#f7f8fb;
  border:1px solid #edf0f5;
  border-radius:14px;
}
.batch-preview-item b{
  width:24px;
  height:24px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:#735cff;
  font-size:12px;
}
.batch-preview-item span{
  color:#404858;
  font-size:13px;
  line-height:1.55;
  max-height:42px;
  overflow:hidden;
}
.batch-preview-more{
  text-align:center;
  color:#8a93a5;
  font-size:13px;
  padding:8px;
}
.batch-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:18px;
}
.batch-primary{
  height:46px;
  min-width:160px;
  border:0;
  border-radius:16px;
  background:linear-gradient(180deg,#151515 0%,#050505 100%);
  color:#fff;
  font-weight:900;
  box-shadow:0 16px 34px rgba(0,0,0,.18);
}
.batch-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 22px 44px rgba(0,0,0,.22);
}
.task-card.is-batch-task{
  border-color:#ece8ff;
}
.task-card.is-batch-task .task-meta span:first-child{
  background:#f4f1ff;
  border-color:#e7ddff;
  color:#735cff;
  font-weight:800;
}
@media(max-width:760px){
  .batch-panel{padding:22px}
  .batch-concurrency{margin-left:0;width:100%;justify-content:space-between}
  .batch-summary{flex-direction:column}
  .batch-open-btn{width:100%}
}


/* =========================================================
   Batch per-item edit + reference images
   ========================================================= */
.batch-panel{
  width:min(980px,calc(100vw - 36px))!important;
}
.batch-textarea{
  min-height:126px!important;
}
.batch-preview{
  max-height:360px!important;
  padding-right:4px!important;
}
.batch-empty{
  border:1px dashed #dfe4ef;
  background:#fbfcff;
  color:#8a93a5;
  border-radius:16px;
  padding:18px;
  text-align:center;
  font-size:13px;
}
.batch-edit-item{
  background:#fff;
  border:1px solid #edf0f5;
  border-radius:18px;
  padding:14px;
  box-shadow:0 8px 22px rgba(20,25,40,.045);
}
.batch-item-head{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:10px;
}
.batch-index-badge{
  width:26px;
  height:26px;
  border-radius:999px;
  background:#f4f1ff;
  color:#735cff;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:12px;
}
.batch-item-head span{
  font-size:13px;
  font-weight:800;
  color:#303746;
}
.batch-item-remove{
  margin-left:auto;
  border:0;
  background:#f6f7fb;
  color:#8a93a5;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.batch-item-remove:hover{
  background:#fff1f1;
  color:#d92d20;
}
.batch-item-textarea{
  width:100%;
  min-height:72px;
  resize:vertical;
  border:1px solid #e6eaf2;
  background:#fbfcff;
  border-radius:14px;
  padding:10px 12px;
  line-height:1.6;
  font-size:13px;
  outline:none;
}
.batch-item-textarea:focus{
  border-color:#9a8bff;
  box-shadow:0 0 0 4px rgba(115,92,255,.09);
}
.batch-ref-grid{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.batch-ref-thumb{
  position:relative;
  width:58px;
  height:58px;
  border-radius:14px;
  overflow:hidden;
  background:#f2f4f8;
  border:2px solid #fff;
  box-shadow:0 8px 18px rgba(20,25,40,.10);
}
.batch-ref-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.batch-ref-thumb button{
  position:absolute;
  right:2px;
  top:2px;
  width:18px;
  height:18px;
  border:2px solid #fff;
  border-radius:999px;
  background:#20242e;
  color:#fff;
  padding:0;
  line-height:12px;
  opacity:0;
  transform:scale(.85);
}
.batch-ref-thumb:hover button{
  opacity:1;
  transform:scale(1);
}
.batch-ref-add{
  width:58px;
  height:58px;
  border:1.5px dashed #dfe4ef;
  background:#fbfcff;
  color:#735cff;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
}
.batch-ref-add span{
  width:24px;
  height:24px;
  border-radius:999px;
  background:#f0eefc;
  position:relative;
}
.batch-ref-add span::before,
.batch-ref-add span::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  background:#735cff;
  border-radius:99px;
  transform:translate(-50%,-50%);
}
.batch-ref-add span::before{width:12px;height:2px}
.batch-ref-add span::after{width:2px;height:12px}
.batch-ref-add em{
  font-style:normal;
  font-size:10px;
  color:#8a93a5;
}
.batch-ref-add:hover{
  border-color:#bcaeff;
  background:#faf8ff;
  transform:translateY(-1px);
}


/* =========================================================
   Batch per-item editor V2 - force visible layout
   ========================================================= */
.batch-panel{
  width:min(1060px,calc(100vw - 32px))!important;
  max-height:90vh!important;
  padding:28px!important;
}
.batch-textarea{
  min-height:110px!important;
  max-height:170px!important;
  font-size:13px!important;
}
.batch-preview{
  max-height:430px!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
  padding:4px 4px 8px!important;
}

/* Kill old compact preview row styles if cached/overlapped */
.batch-preview-item{
  display:none!important;
}

.batch-edit-item{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) 188px!important;
  gap:12px!important;
  align-items:stretch!important;
  background:#fff!important;
  border:1px solid #e8ecf4!important;
  border-radius:18px!important;
  padding:12px!important;
  box-shadow:0 10px 24px rgba(20,25,40,.055)!important;
}
.batch-item-head{
  grid-column:1!important;
  grid-row:1!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  margin:0!important;
}
.batch-index-badge{
  width:30px!important;
  height:30px!important;
  border-radius:50%!important;
  background:#f2eeff!important;
  color:#735cff!important;
  display:grid!important;
  place-items:center!important;
  font-size:13px!important;
  font-weight:900!important;
}
.batch-item-head > span{
  writing-mode:vertical-rl!important;
  color:#8a93a5!important;
  font-size:12px!important;
  font-weight:800!important;
}
.batch-item-remove{
  margin:0!important;
  width:34px!important;
  height:24px!important;
  padding:0!important;
  border:0!important;
  border-radius:999px!important;
  background:#f6f7fb!important;
  color:#8a93a5!important;
  font-size:11px!important;
  font-weight:800!important;
}
.batch-item-textarea{
  grid-column:2!important;
  grid-row:1!important;
  min-height:122px!important;
  width:100%!important;
  resize:vertical!important;
  border:1px solid #e5eaf3!important;
  background:#fbfcff!important;
  border-radius:16px!important;
  padding:12px 14px!important;
  line-height:1.65!important;
  font-size:13px!important;
  outline:none!important;
}
.batch-item-textarea:focus{
  border-color:#9a8bff!important;
  box-shadow:0 0 0 4px rgba(115,92,255,.10)!important;
}
.batch-ref-grid{
  grid-column:3!important;
  grid-row:1!important;
  align-content:flex-start!important;
  display:grid!important;
  grid-template-columns:repeat(2, 78px)!important;
  grid-auto-rows:78px!important;
  gap:8px!important;
  padding:8px!important;
  border:1px dashed #dfe4ef!important;
  border-radius:16px!important;
  background:#fbfcff!important;
  min-height:122px!important;
  max-height:174px!important;
  overflow:auto!important;
}
.batch-ref-thumb{
  position:relative!important;
  width:78px!important;
  height:78px!important;
  border-radius:14px!important;
  overflow:hidden!important;
  background:#eef1f6!important;
  border:2px solid #fff!important;
  box-shadow:0 8px 18px rgba(20,25,40,.10)!important;
}
.batch-ref-thumb img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}
.batch-ref-thumb button{
  position:absolute!important;
  right:3px!important;
  top:3px!important;
  width:20px!important;
  height:20px!important;
  border:2px solid #fff!important;
  border-radius:50%!important;
  background:#20242e!important;
  color:#fff!important;
  opacity:0!important;
  transform:scale(.85)!important;
  line-height:14px!important;
  padding:0!important;
}
.batch-ref-thumb:hover button{
  opacity:1!important;
  transform:scale(1)!important;
}
.batch-ref-add{
  width:78px!important;
  height:78px!important;
  border:1.5px dashed #d8deea!important;
  background:#fff!important;
  border-radius:14px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  color:#735cff!important;
}
.batch-ref-add span{
  width:28px!important;
  height:28px!important;
  border-radius:50%!important;
  background:#f0eefc!important;
  position:relative!important;
}
.batch-ref-add span::before,
.batch-ref-add span::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  background:#735cff!important;
  border-radius:99px!important;
}
.batch-ref-add span::before{width:14px!important;height:2px!important}
.batch-ref-add span::after{width:2px!important;height:14px!important}
.batch-ref-add em{
  font-style:normal!important;
  font-size:11px!important;
  font-weight:800!important;
  color:#7a8496!important;
}
.batch-ref-add:hover{
  border-color:#bcaeff!important;
  background:#faf8ff!important;
  transform:translateY(-1px)!important;
}

.batch-empty{
  border:1px dashed #dfe4ef!important;
  background:#fbfcff!important;
  color:#8a93a5!important;
  border-radius:16px!important;
  padding:22px!important;
  text-align:center!important;
  font-size:13px!important;
}

@media(max-width:820px){
  .batch-edit-item{
    grid-template-columns:1fr!important;
  }
  .batch-item-head,
  .batch-item-textarea,
  .batch-ref-grid{
    grid-column:1!important;
    grid-row:auto!important;
  }
  .batch-item-head{
    flex-direction:row!important;
  }
  .batch-item-head > span{
    writing-mode:horizontal-tb!important;
  }
}
